Vuhelper
12-29-2012, 03:25 PM
CS506 Web Design and Development Quiz No.1 Solved Fall Semester 2012-13
1 What is true about abstract classes?
Ans: The objects of abstract classes can not be instantiated
2 What if we declare main method as private?
Ans: Program compiles but does not run
Reason : if we declare main method as private then the program compiles successfully but does not run because main method is the actual execution area if declared private then other classes will not be able to get access to main method and will not display (as in case of GUI)
3 which statement is used to execute Select statement?
Ans: rs = executeQuery(sql)
4 GetColumnCount ( ) is method of
Ans: ResultsetMetaData p#175
5 Window Listener events are of . types
Ans: 7 p#133
6 Constructor is replaced with . In Aplet
Ans init( ) p#202
7 Is it possible to have more than one main method within the same class?
Ans: False
Reason : There is only one main method all other classes are declared inside the main method to get access for this purpose main method is always declared as public
8 Create, Drop, Alter are
Ans DDL (Data Definition Languages) p#158
9 DNS stands for ..
Ans: Data Source Name p#150
10 Pure abstract class is ..
Ans: Interface p#98
Another Quiz
Which of the following is a general purpose container?
Select correct option:
JFrame
Dialog
JPanel
JApplet
Which of the following package needs to be import while handling files?
Select correct option:
java.util
java.io
java.awt
javax.swing
Exception handling code is written in _______
Select correct option:
try block ot confirm
catch block
finally block
throws clause
Which of the following stream is a Node stream?
PrintWriter
FileWriter
BufferedReader
All of given option
Which of the following stream read/write data in the form of bytes?
FileReader
FileWriter
PrintWriter
FileInputStream
Which of the following command is used to compile Java code?
java filename
javac filename.java
javac filename
java filename.java
1 What is true about abstract classes?
Ans: The objects of abstract classes can not be instantiated
2 What if we declare main method as private?
Ans: Program compiles but does not run
Reason : if we declare main method as private then the program compiles successfully but does not run because main method is the actual execution area if declared private then other classes will not be able to get access to main method and will not display (as in case of GUI)
3 which statement is used to execute Select statement?
Ans: rs = executeQuery(sql)
4 GetColumnCount ( ) is method of
Ans: ResultsetMetaData p#175
5 Window Listener events are of . types
Ans: 7 p#133
6 Constructor is replaced with . In Aplet
Ans init( ) p#202
7 Is it possible to have more than one main method within the same class?
Ans: False
Reason : There is only one main method all other classes are declared inside the main method to get access for this purpose main method is always declared as public
8 Create, Drop, Alter are
Ans DDL (Data Definition Languages) p#158
9 DNS stands for ..
Ans: Data Source Name p#150
10 Pure abstract class is ..
Ans: Interface p#98
Another Quiz
Which of the following is a general purpose container?
Select correct option:
JFrame
Dialog
JPanel
JApplet
Which of the following package needs to be import while handling files?
Select correct option:
java.util
java.io
java.awt
javax.swing
Exception handling code is written in _______
Select correct option:
try block ot confirm
catch block
finally block
throws clause
Which of the following stream is a Node stream?
PrintWriter
FileWriter
BufferedReader
All of given option
Which of the following stream read/write data in the form of bytes?
FileReader
FileWriter
PrintWriter
FileInputStream
Which of the following command is used to compile Java code?
java filename
javac filename.java
javac filename
java filename.java