Logo

Java Questions Set 23:

Quiz Mode

Can we extending more than one classes

1
2

Solution:

Which keyword must be used to handle exceptions?

1
2
3
4

Solution:

Which class in Java provides various types of rounding functions?

1
2
3
4

Solution:

  SetProperties method changes the set of Java Properties which are not persistent 

1
2

Solution:

The method which remove the spaces before and after the string is 

1
2
3
4

Solution:

String str = “H e l l o W o r l d”; 

System.out.print(str.length());

What is the output of the above code?

1
2

Solution:

public class operators {

public static void main(String[] args)

{

int a = 20, b = 10, c = 0, d = 20, e = 40, f = 30;

System.out.println((a + b / d));

}

}

Solution:

Select the correct option for a valid declaration of a float variable from the following code segment in Java.

1
2
3
4

Solution:

class GFG {

public static void main (String[] args) {

  boolean a=true;

  boolean b=!a;

  boolean c=!a^b;

  boolean d=!(c^!!b);

  System.out.println(c+" "+d);

}

}

1
2
3
4

Solution:

Which of the following is an incorrect statement regarding the use of generics and parameterized types in Java?

1
2
3
4

Solution: