Logo

Java Questions Set 70:

Quiz Mode

getfirst() method is to return  the first element

1
2

Solution:

Which of the following is not a primitive data type in Java?

1
2
3
4

Solution:

Which of the following is not a numeric literal?

1
2
3
4

Solution:

Which of this method is implemented by Thread class?

1
2
3
4

Solution:

What will be the output of the following Java code?

1
2
3
4

Solution:

________ is also known as Runtime polymorphism and  ________is also known as Compile time polymorphism.

1
2
3
4

Solution:

Find the correct output.

public class abekus

{

  public static int sum(int a, int b){

    return a+b;

  }

public static void main(String[] args) {

System.out.println(sum(sum(4,2),4));

}

}

1
2
3
4

Solution:

Which of the following is incorrect

1
2
3
4

Solution:

  Statement 1 -  Continue is used with the switch statement 

Statement 2 -   Exit is used with the switch statement 

Statement 3 -   break is used with the switch statement 

1
2
3
4

Solution:

what should be the output of this code block ?

 public class aekus {

  public static void main(String[] args) {

   int[] array = {

    1,

    2,

    3,

    4,

    5

   };

   for (int i = -1; i < 5; i++)

    System.out.print(array[i]);

  }

 }

1
2
3
4

Solution: