Logo

Java Questions Set 143:

Quiz Mode

class test {

public static void main (String[] args) {

   System.out.println('a'==97.000);

}

}

1
2

Solution:

Which of these is the superclass of the wrapper classes Long, Character, and Integer?

1
2
3
4

Solution:

Which interface is the base interface that all other Java collection interfaces inherit from?

1
2
3
4

Solution:

Which exception is thrown when divided by zero

1
2
3
4

Solution:

Which of these methods can be used to check whether a given value is a number or not?

1
2
3
4

Solution:

The process of wrapping up of data in to a single unit (i.e _______)  is called encapsulation .

Fill in the above blank.

1
2
3
4

Solution:

public class output{

public static void main(String args[]){

int a=10;

int b=20;

int sum=0;

sum= a++ + b++;

System.out.println(sum);

 }

}

1
2
3
4

Solution:

Which of the following is not an advantage of the Hibernate Criteria API?

1
2
3
4

Solution:

What is the output of the following Java code?


public class ex {

  final int x = 20;


  public static void main(String[] args) {

    ex myObj = new ex();

    myObj.x = 40;

    System.out.println(myObj.x);

  }

}


1
2
3
4

Solution:

What is the correct output?

 class Abekus {

  public static void show() {

 System.out.println("Abekus::show() called");

 }

}

class Derived extends Abekus {

 public static void show() {

 System.out.println("Derived::show() called");

 }

}

public class Main {

 public static void main(String[] args) {

  Abekus a = new Derived();;

  a.show();

 }

}

1
2
3
4

Solution: