1. All java classes are derived from A) java.lang.Class B) java.util.Name C) jav
ID: 3547974 • Letter: 1
Question
1. All java classes are derived from
A) java.lang.Class
B) java.util.Name
C) java.lang.Object
D) java.awt.Window
2. The jdb is used to
A) Create a jar archive
B) Debug a java program
C) Create C header file
D) Generate java documentation
3. What would happen if "String[]args" is not included as argument in the main method.
A) No error
B) Compilation error
C) Program won't run
D) Program exit
4. For execution of DELETE SQL query in JDBC, ............. method must be used.
A) executeQuery()
B) executeDeleteQuery()
C) executeUpdate()
D) executeDelete()
5. Which method will a web browser call on a new applet?
A) main method
B) destroy method
C) execute method
D) init method
6. Which of the following is not mandatory in variable declaration?
A) a semicolon
B) an identifier
C) an assignment
D) a data type
Explanation / Answer
1. All java classes are derived from
C) java.lang.Object
Class Object is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class
2. The jdb is used to
B) Debug a java program
The Java Debugger, jdb, is a dbx-like command-line debugger for Java classes. It uses the Java Debugger API to provide inspection and debugging of a Java interpreter.
3. What would happen if "String[]args" is not included as argument in the main method.
C) Program won't run
The main(String[]) is the signature of the main method that the Java interpretor looks for to run first. If that String[] args argument is not given, the function is consdered to be over-loaded(i.e. of same name but different signature) Thus, the program will be compiled but the interpretor won't recognize the entry point and probably give an error at run time saying that no main method could be found.
4. For execution of DELETE SQL query in JDBC, ............. method must be used.
C) executeUpdate()
The executeQuery() returns a resultset and is thus used for queries which return a result(e.g. select). The executeUpdate() is only for Update queries and returns an integer which denoted the number of rows affected by the query.
5. Which method will a web browser call on a new applet?
D) init method
When an applet is launched in the browser, the init() method of the specified applet is executed first.
6. Which of the following is not mandatory in variable declaration?
C) an assignment
Syntax - datatype identifier [ = value] ;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.