CS506 GRAND QUIZ SOLVED 100% VERIFIED BY ADMIN (MID TERM SYLLABUS)
Q1: Adapter calsses have been defined for listener except _______ interface.
A) MouseListener
B) KeyListener
C) WindowListener
D) ActionListener (page 119) (100% Sure)
Q2: Choose the correct syntax to declare an abstract java class named as "Person".
A) abstract public class Person{}
B) public class Person abstract{}
C) public class abstract Person{}
D) public abstract class Person{} (page 83) (100% Sure)
Q3: TELNET works on ______ port.
A) 21
B) 23 (page 193) (100% Sure)
C) 80
D) 84
Q4: WindowListener interface contains _____ methods.
A) Four
B) Six
C) Seven (page 115) (100% Sure)
D) Eight
Q5: It is verified by ______ that not all bytecodes violate java security restrictions.
A) editor
B) compiler
C) class loader
D) bytecode verifier (page 12) (100% Sure)
Q6: Java defines ______ for the listener interfaces having more than one event handling methods.
A) Wrapper classes
B) Abstract classes
C) Concrete classes
D) Adapter classes (page 118) (100% Sure)
Q7: Which of the following classes is capable to instantiate?
A) Abstract class
B) Concrete class (page 83) (100% Sure)
C) Interface class
D) None of the given
Q8: The method "Math.random()" returns positive double value greater than or equal to 1 or less than 10.
A) True
B) False (page 187) (100% Sure)
Q9: If a class implements an interface then _________.
A) an interface must provide implementation of all methods.
B) a class may or may not provide implementation of all methods of interface
C) a class must provide implementation of all methods of interface (page 85) (100% Sure)
D) class will compile successfully if class do not implements methods of interface
Q10: ResultSet provides various getters to retrieve _______.
A) data of the column (page 134) (100% Sure)
B) data of the row
C) data of the row and column
D) column headers
Q11: Static methods can only access ________.
A) Instance variables
B) Instance methods
C) Static variables and methods (page 33) (100% Sure)
D) Both static and instance members
Q12: The following code creates and starts a timer that fires an action event once per ________.
Timer t = new Timer(1000,this);
t.start();
A) Second (page 190) (100% Sure)
B) Minute
C) Hour
D) Day
Q13: In given lines of code ________ is static variable and _______ is static method.
System.out.println("CS506");
JOptionPane.showMessageDialog(null, "CS506");
A) System, JOptionPane
B) Println, showMessageDialog
C) Println, JOptionPane
D) Out, showMessageDialog (Confirm) (100% Sure)
Q14: Which of the following exception belongs to a category of un-checked exception?
A) IOException
B) Null Pointer Exception (page 56) (100% Sure)
C) AWTException
D) ClassNotFoundException
Q15: Which of the following statement object is used to execute precompiled SQL statements?
A) Statement
B) PreparedStatement (page 140) (100% Sure)
C) Callable Statement
D) None of given
Q16: Which of the following function will be used to register event handler with events generator, where event generator in button?
A) addAction()
B) addActionListener() (page107) (100% Sure)
C) addListener()
D) registerListener()
Q17: Which of the following stream rea/write data in the form of bytes?
A) FileReader
B) FileWriter
C) PrintWriter
D) FileInputStream (page 71) (100% Sure)
Q18: What happen if static modifier is removed from the signature of main method?
A) The program will not compile
B) The program will compile and run successfully
C) The program will compile but not run (Confirm) (100% Sure)
D) None of given options.
Q19: The output of given someTest function is ______.
public void someTest(){
int x;
System.out.println(x);
}
A) x
B) syntax error
C) compile time error (Confirm) (100% Sure)
D) run time error
Q20: The "MouseDragged" and "mouseMoved" methods are defined in ________ interface.
A) MouseListener
B) ItemListener
C) MouseMotionListener (page 113) (100% Sure)
D) ActionListener
Q21: Which of the following methods of Graphics object is used to draw a rectangle?
A) DrawRect(10,10,20,20);
B) drawRect(10,10,20,20); (page 172) (100% Sure)
C) drawRectangle(10,10,20,20);
D) DrawRectangle(10,10,20,20);
Q22: If you want the timer to fire only the first time and then stop, invoke ________.
A) setOnce(true)
B) setOnce(false)
C) setRepeats(true)
D) setRepeats(false) (Confirm) (100% Sure)
Q23: Java compiler is called _______ on UNIX or windows.
A) javac (page 06) (100% Sure)
B) java c
C) cjava
D) c java
Q24: HashMap takes key as a/an ______.
A) Object (page 47) (100% Sure)
B) Array
C) Primitive value
D) Function
Q25: Java language has a little worse performance than C++ language because ______.
A) It is object oriented
B) It uses built in libraries
C) It does not use pointers
D) It checks all errors, malicious and viruses (page 05) (100% Sure)
Q26: The toString() method returns a ______ representation of _______.
A) int, string
B) string, int
C) string, object (page 34) (100% Sure)
D) object, string
Q27: Which of the following blocks are always executes irrespective of exception occurrence?
A) Try block
B) Catch block
C) Throws block
D) Finally block (page 56) (100% Sure)
Q28: An applet can be defined as:
A) A small program written in Java and included in HTML page (page 181) (100% Sure)
B) A small program written in JSP and included in HTML page
C) A small program written in Serverlet and included in HTML page
D) A small program written in JSF and included in HTML page
Q29: A database that is created in MS Access 2003 will be saved with _______ extension.
A) .java
B) .class
C) .doc
D) .mdb (page 130) (100% Sure)
Q30: Java core language is ______ than C++.
A) Simpler (page 05) (100% Sure)
B) Difficult
C) Complex
D) Less secure
No comments:
Post a Comment