Wednesday 13 June 2012

CS506 Quiz No.2 June 13,2012



From: Umair Saulat <saulat.umair@googlemail.com>
Date: Wed, Jun 13, 2012 at 5:20 AM
Subject: ))))Vu & (((( CS506 Quiz No.2 June 13,2012
To: mcs-mit@googlegroups.com, Virtual_c@googlegroups.com, vu-club@googlegroups.com, vu-rocks@googlegroups.com, vu-rose@googlegroups.com, vu-star-angels@googlegroups.com, vu-structure@googlegroups.com, vu2care@googlegroups.com, vu_askarimit@googlegroups.com, vuhelp_pk@googlegroups.com, vusr@googlegroups.com, zavia-lms@googlegroups.com, attock-vu-group <attock-vu-group@googlegroups.com>, Dare Arqam VU <dare-arqam-vu@googlegroups.com>, vu-and-company <vu-and-company@googlegroups.com>, vu-edu-pk' <vu-edu-pk@googlegroups.com>, vu-study-corner <vu-study-corner@googlegroups.com>, vustudymasti <vustudymasti@googlegroups.com>, vuzs <vuzs@googlegroups.com>


CS506 Web Design and Development

Quiz No.2 June 13, 2012

 

 

 

Which of the following approch is used to create threads in java?

Inheritance]

Interface

Both inheriance and interface (right Answer)

None of these

 

Why we use RequestDispatcher to forward a request to another resource(servlet, html, jsp), instead of using a sendRedirect()?

sendRedirect() is not supported in servlet API.

RequestDispatcher is not supported in servlet API.

RequestDispatcher is efficient and allows the server to maintain request status.

None of these (right Answer)

 

 

Which of the following method of an Applet is called every time when page is minimized?

start()

init()

stop()(right Answer)

destroy()

 

 

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. (right Answer)

It first performs custom painting and then paints the background.

 

 

 Which of the following is NOT true for an Applet?

A small program written in Java and included in a HTML page.  

It is independent of the operating system on which it runs.

They have no access to the client's file system. (right Answer)

An applet is a Panel that allows interaction with a Java program

 

 

Which of the following syntax is used to get DataBaseMetaData object?

 

ResultSetMetaData md = con.getMetaData();

// where con is Connection object

ResultSetMetaData md = rs.getMetaData();

// where rs is ResultSet object (right Answer)

ResultSetMetaData md = st.getMetaData();

// where st is Statement object

ResultSet md = rs.getMetaData();

// where rs is ResultSetMetaDta object

 

 

Why we use RequestDispatcher to forward a request to another resource(servlet, html, jsp), instead of using a sendRedirect()?

sendRedirect() is not supported in servlet API.

RequestDispatcher is not supported in servlet API.

RequestDispatcher is efficient and allows the server to maintain request status.

None of these (right Answer)

 

 

getColumnCount() is a method of ________ object.

Statement

ResultSet(right Answer)

ResultSetMetaData

DataBaseMetaData

 

doGet() and doPost() receive ServletRequest and ServletResponse objects as an arguments which facilitate interaction between the client and the server.

True (right Answer)

False

 

Which of the following method is used to move the cursor to given row number?

absolute(int);

absolute();

moveToInsertRow(int);

insertRow();

 

Which of the following method of an Applet is called every time when page is minimized?

start()

init()

stop()(right Answer)

destroy()

  

 

HTML form data can be processed by JSP
TRUE( right Answer)
FALSE

 

From the following methods, which method cannot be overridden in the JSP page

_jspService() (right Answer)
jspDestroy()
jspInit()
None of these

 

Which of the following object is used for sharing resources among different servlets of same application?
ServletConfig
ServletRequest
ServletResponse
Servlet Context  (right Answer)

getParameters() method returns an array of strings containing the values for a specified servlet parameter.
TRUE
FALSE(right Answer)

 

 

Socket is a ___________ communication channel between hosts.

uni-directional

bi-directional (right Answer)

multi-directional

None of these

 

 

setAttribute(String, Object) associates a ----------with a name.

None of these

Object

String

Value

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

Directories (right Answer)

Folders

Libraries

None of these

 

When JSP page compiled, it is translated into?

Applet

Application

Servlet (right Answer)

Web Browser

 

From the following which ID is transmitted between the client and the server

Session ID (right Answer)

Network ID

Server ID

None of these

 

To define the error page in JSP we use following tag?

exception-type

error-type

error-page (right Answer)

exception-page

 

Which of the following is called Іpure abstract classІ?

Concrete Class  (right Answer)

Wrapper Class

Interface

Abstract class with no abstract method

 

The relationship between class and interface is called ____________

'Is a' relationship

'Has  a' relationship

'Responds to' relationship (right Answer)

None of the above given

 

Which of the following statement object is used to execute simple SQL statement?

Statement

PreparedStatement

CallableStatement

None of given (right Answer)

 

Which of the following function will be used to register even handler with events generators (button)?

addAction()

AddActionListener() (right Answer)

AddKListener()

ActionListener()

 

 

 

WindowsListener interface contains ___________ methods

Four

Six

Seven

Eight  (right Answer)

 

 

Java defines _____ for the listener interfaces having more than one vent handling methods.

Wrapper Classes

Abstract Classes

Concrete Classes

Adapter Classes  (right Answer)

 

Which of the following statement object is used to execute store procedures?

Statement

PreparedStatment

CallableStatement  (right Answer)

None of the above given

 

 

Which of the following object is passed as an argument to paintComponent() method?

Image object

Jpanel object  (right Answer)

JFrame onject

Graphic object

 


previous() is a method of __________ object.

Statement

ResultSet

ResultSetMetaData

Connection

 

Which of the following problem occurs with lower priority threads?

Race condition

Starvation (right Answer)

Average waiting time

Process death

 


Servlets are used to

Create graphics

Provide dynamic web contents which extend web servers  (right Answer)

Develop applets

Create GUI

 

 

Which of the following is NOT a part of HTTP request?

Request method

URI

Status code (right Answer)

Header fields

 

 

Which of the following object is used for sharing resources among different servlets of same application?

ServletConfig

ServletRequest

ServletResponse

ServletContext (right Answer)

 

 

Which of the following method needs to ovveride while handling threads in java?

init()

start()

run()(right Answer)

runnable()

 

 

Which of the following method is called only once during life cycle of Servlet

Service()

Init()(right Answer)

Destroy()

Start()

 

 

Which of the following method needs to override while handling threads in java?

Select correct option:

init()right Answer)

start()

run()

runnable()

 

 

isReadOnly() is a method of _________ object.

ResultSet

ResultSetMetaData

DataBaseMetaData

Connection

 

Which of the following syntax is used to get DataBaseMetaData object?

DataBaseMetaData md = rs.getMetaData();

// where rs is ResultSet object (right Answer)

DataBaseMetaData md = st.getMetaData();

// where st is Statement object

DataBaseMetaData md = con.getMetaData();

// where con is Connection object

DataBaseMetaData md = rsmd.getMetaData();

// where rsmd is ResultSetMetaData object

 

Interface of HttpServletResponse extends class ServletResponse

False

True  (right Answer)

 

Which of the following method is used to determine whether a database is read only or not?

isReadonly()

isReadOnly()

isreadonly()

IsReadOnly()

 

 

 

Servlet mapping is defined in ________

servlet

web.xml (right Answer)

html

JSP

 

Which of the following is NOT a web technoloy of Java?

Servlet

JSP

ASP

JSF (right Answer)

 

 

Which of the following is NOT true about HTTP?

HTTP is a stateless protocol

HTTP is a request response communication model

HTTP maintains user session between successive requests. (right Answer)

HTTP has no built-in state management between successive requests.

 

getrequest() method gets information from a client and postrequest() method posts data to a client.

True (right Answer)

False

 

 

 

getAttribute(String) extracts----------- stored value from a session object

Subsequently

None of these

Previously (right Answer)

Currently

 

getParameters() method returns an array of strings containing the values for a specified servlet parameter.

True

False (right Answer)

 

To destroy the session in Servlet we use?

session.destroy()

session.invalidate()

session.end()(right Answer)

session.Kill()

 

From the following which session tracking technique is used when new session is started?

Cookies

URL Rewriting

Both Cookies and URL Rewriting (right Answer)

None of these

 

HttpSession stores session information in

File system of client

File system of server

A cookie (right Answer)

A session object

 

HttpServletResponse object is created when web server executes the servlet. This object is passes to the servlet service method which passes it to doGet () or doPost().

True (right Answer)

False

 


--
Zindagi mein 2 Logo ka buhat khayal rahkoooo

Ist woh jiss ney tumhari jeet ke Liye buhat kuch hara hoo (Father)

2nd woh jiss ko tum ney har dukh me pukaara hoo (Mother)

Regards, 
Umair Saulat


No comments:

Post a Comment

Note: only a member of this blog may post a comment.