CS506 Web Design and Development Quiz 1 Solved Fall 2012

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)   P#159

 

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

 

 

 

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 following stream is a filter stream?

FileWriter

FileReader

  • BufferedReader

All of given options

 

 

 

An event in java is represented as ________

Operator

Function

  • Object

Primitive data type

 

Which of the following belongs to a category of checked exception?

Null Pointer exception

IOException

Array index out of bounds

NumberFormatException

 

Packages are the way to organize files into different ————-according to their functionality, usability as well as category they should belong to.

  • Directories

Folders

Libraries

None of these

 

 

DOWNLOAD SOLUTION HERE
loading...