Logo

Java Questions Set 114:

Quiz Mode

What is the priority of the thread in the following Java program?

1
2
3
4

Solution:

Which of this datatype value is returned by equals() method?

1
2
3
4

Solution:

What is the correct way to implement an interface A in a class B?

1
2
3
4

Solution:

Which of these is the process of extracting or recovering the state of an object from a stream?

1
2
3
4

Solution:

What is a HashMap in Java?

1
2
3
4

Solution:

What is the use of an interpreter?

1
2
3
4

Solution:

What is an instance method in Java?

1
2
3
4

Solution:

Statment 1- put() method is used to insert value and its key

 Statment 2- set() method is used to insert value and its key 

Statment 3- addelement() method is used to insert value and its key 

1
2
3
4

Solution:

What is process switching?

1
2
3
4

Solution:

What will be the output of the following code?

 class A

    {

        public int a;

  static int b;

        void cal(int x, int y)

        {

            a +=  x ;

            b +=  y;

        }        

    }    

    class main

    {

        public static void main(String args[])

        {

            A obj1 = new A();

            A obj2 = new A();   

            obj1.a = 0;

            obj1.b = 0;

            obj1.cal(10, 20);

            obj2.a = 0;

            obj2.cal(20, 30);

            System.out.println(obj1.a + " " + obj2.b);     

        }

   }

1
2
3
4

Solution: