Logo

Java Questions Set 136:

Quiz Mode

An abstract class can contain also 0(zero) abstract methods. 

1
2

Solution:

What is the output of the following code?

1
2
3
4

Solution:

How can you make a Java thread stop?

1
2
3
4

Solution:

 public <T1, T2, …, Tn> name<T1, T2, …, Tn> { /* … */ } is used to define generic method

1
2

Solution:

Which of these is superclass for every class?

1
2
3
4

Solution:

Which method can be used to determine which key was pressed?

1
2
3
4

Solution:

Which of these classes is used to create an object whose character sequence is mutable?

1
2
3
4

Solution:

public class A

  {

        public static void main(String args[]) 

        {    

             int a; 

             a = 100;

             a = a >> 1;

             System.out.println(a);

        } 

    }



1
2
3
4

Solution:

What will be the output of the following Java program?


class Output

{

public static void main(String[] args)

{

String s1 = "Hello World";

String s2 = s1.substring(0, 4);

System.out.println(s2);

}

}

1
2
3
4

Solution:

In Servlet Terminology, what provides a runtime environment for Java EE (J2EE) applications? It performs the following operations:

  • Life Cycle Management
  • Multithreaded support
  • Object Pooling
  • Security

1
2
3
4

Solution: