Logo

Java Questions Set 163:

Quiz Mode

Predict the output of the following Java code.

1
2
3
4

Solution:

Predict the output of the following Java code.

1
2
3
4

Solution:

Which keyword is used to define packages in Java?

1
2
3
4

Solution:

How many classes can be defined in a single Java file?

1
2
3
4

Solution:

Which of the following is used to implement runnable interface.

1
2
3
4

Solution:

Which of the following imports all Java classes concerned with database connectivity.

1
2
3
4

Solution:

what happens in the case of multiple catch block executes

1
2
3

Solution:

class testcase{

 public static void main (String []args) {

   try{

     int a= Integer.parseInt("Abekus");

     }

  }

}




1
2
3
4

Solution:


Statement 1- Collection is an Interface

Statement 2- A list is an Interface

Statement 3- A list is an object 

 Statement 4- Arraylist is a class

1
2
3
4

Solution:

public class Abekus

{

     public static void main(String args[])

     {

           StringBuffer s1 = new StringBuffer("Contribute");

           s1.setCharAt(1, 'i');

           s1.setCharAt(7, 'd');

           System.out.println(s1);

     }

}

1
2
3
4

Solution: