Logo

Java Questions Set 29:

Quiz Mode

Break statement causes an exit from-

1
2
3
4

Solution:

The Runnable interface contains all the methods used for handling thread related operations in Java 

1
2

Solution:

Which of these can be used to fully abstract a class from its implementation?

1
2
3
4

Solution:

Which of the following is a valid array declaration ?

1
2
3
4

Solution:

Which function of the pre-defined class Thread is used to check whether the current thread being checked is still running?

1
2
3
4

Solution:

Which of the following is true about Constructor?

1
2
3
4

Solution:

What will be the output of the following code?


class A

    {

        public static void main(String args[])

        {

            String str = "I eat Mango";   

            System.out.println(str.charAt(2));     

        }

   }

1
2
3
4

Solution:

What is an Atomic action in Concurrency in Java?

1
2
3
4

Solution:

During method overloading, which of the following task does not occur?

1
2
3
4

Solution:

Select the correct option for the following Java code.

public class Abekus extends Thread {

public static void main(String[] args) {

try {

Thread t1 = new Thread(new Abekus());

Thread t2 = new Thread(new Abekus());

t1.start();

t2.start();

}

catch (Exception e) {

System.out.print("First catch");

}

}

public void run() {

for (int i = 0; i < 2; i++)

{

try {

Thread.sleep(100);

}

catch (Exception e) {

System.out.print("Second catch ");

}

System.out.print(Thread.currentThread().getName());

}

}

}

1
2
3
4
5

Solution: