Multiple Choice Question

Quiz Guidelines

 

QID: 
255
Question: 

Identify the correct constructs.

Select 1 option

A. try {
        for( ;; );
        }finally { }
B.try {
     File f = new File("c:\a.txt");
     } catch { f = null; }
C.int k = 0;
     try {
      k = callValidMethod();
     }System.out.println(k);
      catch { k = -1; }
D.try {
    try {
    Socket s = new ServerSocket(3030);
    }catch(Exception e) {
    s = new ServerSocket(4040);
      } 
 }
E. try {
        s = new ServerSocket(3030);
        } catch(Exception t){ t.printStackTrace(); }
           catch(IOException e) {
           s = new ServerSocket(4040);
          }catch(Throwable t){ t.printStackTrace(); }

F.int x = validMethod();
      try {
      if(x == 5) throw new IOException();
     else if(x == 6) throw new Exception();
     }finally {
     x = 8;
    }catch(Exception e){ x = 9; }

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!