Logo

Java Questions Set 155:

Quiz Mode

 BufferedWriter is a type of charStreamReader

1
2

Solution:

What is the output of the following Java code?

1
2
3
4

Solution:

Dictionary class object uses the key to store value 

1
2

Solution:

Predict the output of the following Java code:

1
2
3
4

Solution:

What does JSL stand for?

1
2
3
4

Solution:

Which of the following annotations is used to avoid execution of JUnit tests?

1
2
3
4

Solution:

class test{

public static void main (String[] args) {

    byte x = 64;

             int i;

             byte y; 

             i = x << 2;

             y = (byte) (x << 2);

             System.out.print(i + " " + y);

}

}

1
2
3
4

Solution:

How can we identify whether a compilation unit is a class or an interface from a .class file?

1
2
3
4

Solution:

When a thread is executing a static synchronized method, no other thread can execute static synchronized method of class since lock is acquired on class.

But it can execute which following methods simultaneously?

1
2
3
4

Solution:

Predict the output of the following Java code.

class AbekusParent

{

AbekusParent() { System.out.println("Abekus Parent class"); }

AbekusParent(int i) {

this();

System.out.println("Abekus Parent value = " + i);

}

}

public class AbekusChild extends AbekusParent

{

AbekusChild() { System.out.println("Abekus Child class"); }

AbekusChild(int i) {

this();

System.out.println("Abekus Child value = " + i);

}

public static void main(String[] args)

{

new AbekusChild(7);

}

}

1
2
3
4

Solution: