Logo

Java Questions Set 72:

Quiz Mode

' -- ' operator is used to decrement the operator by

1
2
3
4

Solution:

In which class is the standard output variable 'out' defined?

1
2
3
4

Solution:

Which of these data type value is  returned by the equals method

1
2
3
4

Solution:

Which of the following package stores all the simple data types in java?

1
2
3
4

Solution:

Which of these methods are used to register a mouse motion listener?

1
2
3
4

Solution:

class test{

public static void main (String[] args) {

     int x=3;

     int y=~x;

     int z;

     z=x>~y?~y:y;

     System.out.println(z);

}

}

1
2
3
4

Solution:

Which statement is wrong about interfaces in Java?

1
2
3
4

Solution:

what should be the output of this code block?

public class abekus {

 public static void main(String[] args) {

  int a = 5;

  a += 5;

  switch (a) {

  case 5:

   System.out.println("5");

   break;

  case 10:

   System.out.println("10");

   break;

  default:

   System.out.println("0");

  }

 }

}

Solution:

What will be the output of the following code?

   class Area

    {

        int breadth;

        int length;

        int area;

        Area() 

        {

            breadth = 5;

            length = 6;

        }

        void area() 

        {

             area = breadth*length;

        } 

    }    

    class A

    {

        public static void main(String args[])

        {

            int breadth = 10 , length = 10 ;

            Area a = new Area();

            a.area();

            System.out.println(a.area);

        }

   }

1
2
3
4

Solution: