Logo

Java Questions Set 222:

Quiz Mode

 We can write any code after throw statement?

1
2

Solution:

 There is no operator overloading in java. True or False?

1
2

Solution:

N parameters are used for a generic method to return and accept a number 

1
2

Solution:

try is used for the block to handle the exceptions generated by a try block 

1
2

Solution:

Which method of StringBuffer class is used to find the length of string?

1
2
3
4

Solution:

Which class is used to create servers that listen for either local or remote client programs?

1
2
3
4

Solution:

Select the correct output for the following Java program.

1
2
3
4

Solution:

What will be the output of the following Java code?


    class binary 

    {

         public static void main(String args[]) 

         {

             int num = 19;

             System.out.print(Integer.toBinaryString(num));

         }

    }

1
2
3
4

Solution:

Which of the following statements about the switch statement is incorrect?

1
2
3
4

Solution:

Predict the output of the following Java code.

class Abekus {

public static void main(String args[])

{

String s1 = "Amrit Anand";

String s2 = "Abekus Abekus";

System.out.print(s1.indexOf("r") + " ");

System.out.print(s1.indexOf("A") + " ");

System.out.print(s2.lastIndexOf("e") + " ");

System.out.print(s2.lastIndexOf("s"));

}

}

1
2
3
4

Solution: