Logo

Java Questions Set 189:

Quiz Mode

To   prevent any method from overriding, we declare the method as,

1
2
3
4

Solution:

what is the order of Enum ?? 

1
2
3
4

Solution:

 public int end(int group) return offset from the last character of the subsequent group 

1
2

Solution:

What will be the output of the following Java code?

1
2
3
4

Solution:

Which of the following is an unchecked exception?

1
2
3
4

Solution:

Which method of the Applet class is automatically called to display the result of the Applet code on the screen?

1
2
3
4

Solution:

class test{

public static void main (String[] args) {

  int i=50000;

  short s=(short)i;

  byte b=(byte)i;

  System.out.println(b+" "+s);

}

}

1
2
3
4

Solution:

In the following Java code, which classes can directly access and change the value of the variable name?

1
2
3
4

Solution:

What is the output of the following Java code?


class Main {

public static void main(String[] args) {

final int i;

i = 20;

System.out.println(i);

}

}

1
2
3
4

Solution:

Predict the output of the following Java code.

class Abekus1 {

protected final void method() {

System.out.println("Abekus1");

}

}

public class Abekus2 extends Abekus1 {

protected final void method() {

System.out.println("Abekus2");

}

public static void main(String[] args) {

Abekus1 o = new Abekus1();

o.method();

}

}

1
2
3
4

Solution: