Logo

Java Questions Set 103:

Quiz Mode

Stack extends 

1
2
3
4

Solution:

FileReader is subtype of InputStreamReader

1
2

Solution:

What is the difference between a Stack and a Queue?

1
2
3

Solution:

Which of these classes is not a member of the java.io package?

1
2
3
4

Solution:

Which interface extends the DataOutput interface?

1
2
3
4

Solution:

Which of these method is used to extract a substring from a string?

1
2
3
4

Solution:

 Which type of program is recommended to include in the try block? 

1
2
3
4

Solution:

Why is Java considered a dynamic language?

1
2
3
4
5

Solution:

Which of the following statements about the finally block in Java is false?

1
2
3
4

Solution:

What will be the output of the program?

public class X
{  
   public static void main(String [] args)
   {
       try
       {
           badMethod(); /* Line 7 */
           System.out.print("A");
       }
       catch (Exception ex) /* Line 10 */
       {
           System.out.print("B"); /* Line 12 */
       }
       finally /* Line 14 */
       {
           System.out.print("C"); /* Line 16 */
       }  
       System.out.print("D"); /* Line 18 */
   }
   public static void badMethod()
   {
       throw new RuntimeException();
   }
}

1
2
3
4

Solution: