Which of the following syntax used to attach an input stream to console? FileReader fr = new FileReader( input.txt ); FileReader fr = new FileReader(FileDescriptor.in); FileReader fr = new FileReader(FileDescriptor); FileReader fr = new FileReader(console); Which one of the following is always executes irrespective of exception occurrence? Try block Catch block Throws block Finally block Which of the following statement is true regarding paintcomponent() method? It tells any components contained by this component to paint themselves. It tells the component to paint its border.
It first paints the background and then performs custom painting. It first performs custom painting and then paints the background. Which of the given statement objects are used to execute using same query multiple times by only changing parameters? Statement CallableStatement PreparedStatement Both PreparedStatement and CallableStatement AWT is also called. Heavy weight components Light weight components Both Light weight and heavy weight components Neither Light weight nor heavy weight Which of the following function will be used to register event handler with events generator, where event generator is button? addaction() addactionlistener()
addlistener() registerlistener() Based on functionality, the streams can be categorized as Byte oriented stream and Node stream Filter stream and Character oriented stream Node stream and Filter stream Byte oriented stream and Character oriented stream Which of the following stream is a Node stream? PrintWriter FileWriter BufferedReader All of given option What will happen if static modifier is removed from the signature of main method? The program does not compile The program compiles and runs successfully
The program compiles but does not run Which of the following command is used to invoke an Applet from command line interpreter? applet htmlfile appletviewer htmlfile appletviewer javafile viewer htmlfile Which of the following function is declared in MouseMotionListener interface? public void mousepressed (MouseEvent me); public void mousedragged (MouseEvent me); public void mouseclicked (MouseEvent me); public void mouseentered (MouseEvent me); is required in order to get an object from collection. Up-casting Down casting
Implicit casting Adapter classes have been defined for listener interfaces except interface. MouseListener KeyListener WindowListener ActionListener Which of the following method is used to execute INSERT, UPDATE and Delete SQL statements? executequery(sql); ExecuteQuery(sql); executeupdate(sql); ExecuteUpdate(sql); Which of the given Listener interface(s) have adopter class(s)? ActionListener MouseMotionListener
AdjustmentListener ItemListener Which of the following is true about abstract class? An abstract class must have all methods declared as abstract methods. A class must have at least one abstract method to be an abstract class. A class without any abstract method can be declared as abstract class. An instance of abstract class can be created. Exceptions must be handled while handling files otherwise it may lead to Logical error Syntax error Run-time error No error One Event handling is a step process. Two
Three Four If a class needs to handle events generated by button then which of the following interface a class needs to implement? ComponentListener KeyListener MouseListener ActionListener JPanel Which of the following is a top level container? ToolBar ScrollPane Dialog start() Which of the following method of an Applet is called every time when page is minimized? init()
stop() destroy() Which of the following stream is a filter stream? FileWriter FileReader BufferedReader All of given options Six There are steps in order to communicate successfully with database. Seven Eight Nine If a class needs to handle events generated by button then which of the following interface a class needs to implement? ComponentListener KeyListener
MouseListener ActionListener Which of the following package needs to be import while handling files? java.util java.io java.awt javax.swing run() Which of the following method takes the place of constructor in an Applet? main() init() start() Which of the following statement regarding Java is false? Java is a programming language A Java program compiles into machine language
Java is case sensitive language Java uses an interpreter Which of the following function is declared in MouseMotionListener interface? public void mousepressed (MouseEvent me); public void mousedragged (MouseEvent me); public void mouseclicked (MouseEvent me); public void mouseentered (MouseEvent me); Which of the following syntax is used to get ResultSetMetaData object? ResultSetMetaData md = con.getmetadata(); // where con is Connection object ResultSetMetaData md = rs.getmetadata(); // where rs is ResultSet object ResultSetMetaData md = st.getmetadata(); // where st is Statement object ResultSet md = rs.getmetadata(); // where rs is ResultSetMetaDta object