0% found this document useful (0 votes)
41 views39 pages

Adv JAVA G Scheme

Uploaded by

shreyadc6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views39 pages

Adv JAVA G Scheme

Uploaded by

shreyadc6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 39

1 Which of the following class is derived from the Container class?

(a) Component
Name of the class used to represent a GUI application
2 window, which is optionally resizable and can have a title
Window
bar, an icon, and menus.

Which abstract class is the super class of all menu related


3 classes? a) MenuComponent

Which of these classes can be added to a Frame


4 component? Menu

Which class can be used to represent a checkbox with a


5 textual label that can appear in a menu? ) MenuBar

Which of these classes can be added to any Container class,


6 using the add method defined in Container class? a) Button

7 Package of drawStringO method is a) java.applet


8 Which method executes only once? (a) startO method

Object which can store group of other objects is


9 a) Collection object
called _ ____

10 All collection classes are available in. (a) java.io package


11 Thread class is available in _ ____ java.io package
12 Minimum threads in a program are _ ____ 1
13 JIT meaning _ ___ Java In Time
14 14 Program which executes applet is known as, _ ___ Applet Engine
15 In mainO method, data type of parameter is --- int

How many keywords (approximately) are available in java?


16 (May vary from version to version) 32

Smallest individual unit in java program is known


17 as, _ String

18 What does A WT stands for? All Writing Tools


19 Which of these methods can be used to know which key is pressed? (a) getModifier()

Which of the following statements about GUI components


20 is wrong? (a) Swing exists since version
1.2 ofthe jdk

21 Package is the first program in java. (a) True


22 What do you mean by javap ? (a) Java disassemble
23 JVMis a __ for byte code. (a) Interpreter

In applet, which of the following is used for accepting user


24 defined parameter? (a) Body

25 What is runnable from following (a) Class


Which of the following applet class displays the result of
26 the applet code on the screen ? (a) paintO

27 On which side applet always executed? (a) Server side


28 Which of the following file is API document? . (a) Html
29 What is another code for java intermediate code? (a) Java code
30 Which stage language java is known as ? (a) Zero
31 Which keyword is used to implement interface in the class? (a) implements
In java, gcO (i.e. garbage collector) method is available in
32 which package? java.lang

33 Vector class is available in. (a) java.io pacakage

Which of the following terms are included inside the


34 Classes
package?

35 Is it possible to write nested try ? Yes


36 Which method cannot be overridden ? ) println
37 In which package, thread class is available? ) Java.util
38 38 Which method executes only once? startO
39 What is jdb ? Java debugger
40 Is it possible to declare method of the interface as private? Yes
41 41 Why we need to write static keyword to main method? It gives access to other methods
42 All methods of the interface are public and abstract." True
43 43 What is the latest version of jdk ? 1.9
If a class contains one or more abstract methods then it is
44 declared as Final

Which of the following command is used to compile java


45 program ? Java

46 Is it possible to create object of interface Yes


When applet is dead, it automatically invokes the
47 method when-we quit the browser. PaintO

In which process we create exact copy of the existing


48 object? Overriding (b)
49 Jar stands for Java archived

50 ) Application Programming
API stands for ____
Infrastructure

If a program consists of three classes, then after


compilation how many class file (s) is are created by
51 Single
compiler?

52 Executable applet is nothing but __ file of the applet. .txt (


53 53 __ types of the literal are available in java. (a) 2
54 In which package, exception class is available? java.lang
Arguments passed via command line are stored as --
55 data type. argument

56 56 Object which can store group of other object is known Java object

57 A GUI ) uses buttons, menus, and icons

58 An object is composed of : ) Properties


Which is a component in A WT that can contain another
59 components like buttons, textfields, labels etc. ? ) Window

The Swing component classes that are used in encapsulate


60 a mutually exclusive set of buttons ? AbstractButton

The Java Foundation Classes (JFC) is a set of GUI


components which simplify the development of desktop
61 True
applications?

The following way is used to create a frame is by creating


62 the object of Frame class? a) Inheritance

In Graphics class, which method is used to set the graphics


63 current color to the specified color? public abstract void setFont(Font font)

In Graphics class, which method is used to draws a


64 rectangle with the specified width and height? (a) public void drawRect(int x, int y, int width, int height)

Which of the following is used to interpret and execute


65 Java Applet Classes hosted by HTML ? (a) Appletviewer
66 Which of the following is not keyword in java ? (a) Abstract
67 Which ofthe following is not keyword injava ? (a) Strictfp
68 68 Which of these methods returns the class of an object? (a) getClassO
69 Which of the following constant are defined in boolean (a) TRUE
Which of these classes encapsulate run-time state of an
70 object? alClass

The relationship between a parent class and a child class is


71 referred to as am) relationship. (a) is-a

Java does not support multiple inheritance, but some ofthe


72 abilities of multiple inheritance are available by _ ____ implementing interfaces

73 Java applets are used to create …………….. applications (a) graphical


A push button is an active control that has a ---
74 appearance One dimensional

75 The various controls supported by A WT are: ) Labels, push buttons


(b) Panel (c) MenuComponent (d) List B

) Panel Dialog Frame D

(c) MenuItem b) MenuBar (d) CheckboxMenultem A

b) Button (c) Window (d) Applet B

(b) MenuItem (c) (d) Menu


CheckboxMenuItem

(b) CheckboxMenuIt (c) Menu (d) MenuBar A

(b) java.io (c) javax.swing (d) java.awt D


(b) init() method (c) stopO method (d) destroyt) method B

(b) Java object (c) Package (d) Wrapper A

b) java.lang packag (c) java.awt package(d) java.util package D


(b) java.lang package (c) java.awt package (d) java.util package B
2 5 many A
Just In Time (c) Join In Time (d) None of above B
Virtual machine JVM (d) None of above A
(b) char (c) String (d) double C

(b) 39 (c) 48 (d) 115 C

Literal (c) Token (d) Operator C

) Abstract Window B
(c) Abstract Writing Toolkit (d) All Window Tools
Toolkit
(c) getActionEvent() (b) getActionKeyO (d) getKeyO A
(b) You cannot place A
WT components on (c) A WT stands for
(d) The A WT Classes are D
Swing Abstract Window
deprecated.
containers Toolkit

(b) False A
(b) Java interpreter (c) Java compiler (d) Java debugger A
(b) Disassemble (c) Compiler (d) Debugger A

(b) Center (c) Applet (d) Param D

(b) Method (c) Interface (d) Variable C

(b) voidO (c) stringO (d) getkeyO A

(b) Client side B


(b) Java (c) Text (d) Doc A
(b) Byte code (c) Reference code (d) None ofthe above B
(b) Two (c) Four (d) Eight B
(b) implement (c) interface (d) extends A

(b) java.io (c) java.util (d) java.awt A

b) java.util package (c) java.lang package (d) java.sql package B

(b) Methods (c) Interfaces (d) All of the above D

No A
printf (c) scanf (d) final D
(b) Java.io (c) Java.lang (d) Java.awt C
(c) stopt) ) initO (d) destroyO B
Java interpreter (c) Java compiler (d) Java disassemble A
No B
(b) It is in syntax (c) To create single copy
(d) None ofthe above

False A
(c) 2.0 1.7 (d) 1.6 B

(c) Abstract ) Static (d) Any ofthe above

(c) Javaq Javap (d) Javac D

No B

StopO (c) bestroyO (d) FinalO C

Overloading (c) Cloning ( d) Cloping C


(c) Java architecture java array none above A
(c) Advance
Application B
Programming (d) None ofthe above.
Programming Interface
Interface

Three (c) Uncountable (d) Zero B

b) .java (c) .class (d) .html C


(b) 5 (c) 6 (d) 9 B
(c) java.io java unit java.awt A

(b) double (c) string (d) integer C

(c) Collection object Package (d) None of the above C


(b) should be easy for a (c) stands for Graphic D
(d) Both (a) and (b).
user to manipulate Use Interaction.

(c) Events (b) Methods (d) All of the above D

(c) Panel Container (d) Frame B

(c) JButton ButtonGroup (d) ImegeIcon B

False A

(b) Association (c) Both (a) and (b) ( d) None ofthe above B

(b) public abstract void setColorCColor


(c) public abstract
c) void(d)
drawStringCString
None of the abovestr, int x, int y) B

(b) public abstract ) public absttact public abstract void


void fillRect(int x, int void drawLine(int drawOval(int x, int y, int
y, int width, xl, int yl, int x2, width, A
int height) int y2) int height)

(b) Appletscreen (c) Appletwatcher (d) Appletshow A


(b) Finalize (c) Assert (d) Boolean B
(b) Transient (c) Instanceof (d) Emun D
(b) ClassO (c) WhoseClassO (d) WhoseObjectO A
(b) FALSE (c) TYPE (d) All of the mentioned D

(b) System (c) Runtime (d) Cache A

(b) was-a (c) has-a (d) instance-of (e) alias A

(d) using public rather than A


(b) creating aliases. (c) importing classes
protected or private modifiers.

(b) user interactive (c) both (a) and (b) (d) none of the above C

(c) Three dimensional (b) Two dimensional (d) None ofthese. C

(b) Checkboxes, choice (c) Scroll bars, text D


(d) All of these
list fields, text area
…………...package contains all the classes and methods
1 required for event handling in Java. java.applet

What is an event in delegation event model used by Java An event is an object


2 programming language ? that describes a state
change. in a source

……………..method are used to register a keyboard event


3 listener. KeyListenerO

4 ____ method are used to register a mouse motion listener. addMouseO

A listener is a
variable that is
notified when an
5 What is a listener in context to event handling? event
occurs.

6 In which library event class is defined? java.io


Which of these methods can be used to determine the type
7 of event ? getSourceO

8 ____ is super class of all the events. ) EventObject


9 .9 If scroll bar is manipulated -,-',_' '''"-.- __ event will be notified a) ActionEvent

10 if we close an applet's window event will be generated ) ActionEvent

Which of these events is generated when a button is


11 pressed? ) ActionEvent

method can be used to obtain the command name for


12 invoking ActionEvent object. ) getCommandO

Which of these are integer constants defined in


13 ActionEvent class? ) ALT_MASK

14 Which of these events is generated by scroll bar? ) ActionEvent

….method can be used to determine the type of


15 adjustment event getTypeO
__ method can be used to know the degree of
16 adjustment made by the user. getValueO

17 If scroll bar is manipulated __ event will be notified. (a) ActionEvent


Which of these constant value will change when the button
18 at the end of scroll bar was clicked to increase its value? (a) BLOCK_DECREMENT

When the size of component is changed, __ event is


19 generated. ) ComponentEvent

When the component is added or removed ? Which of these


20 events is generated ? (a) ComponentEvent

…………...method can be used to obtain the referenc.e to the


21 container that generated a ContainerEvent. ) getContainerO

22 Which of the following methods can be used to get reference


22 to a component that was affected by the container? (a) getComponentO

Which of the following is lere integer constants of (a)


23 ComponentEvent class? COMPONENT_HID
DEN

…………...event is generated when computer g~~or losses


24 input focus. ComponentEvent

25 25 FocusEvent is subclass of which of these classes? ComponentEvent


26 ___ can be used to know the type of focus change. a) typeFocusO
27 ___ is superclass of Container Event class. ) WindowEvent
Which of the following method can be used to obtain the
28 coordinates of a mouse? ) getPointO

29 ___ ' method can be used to change location of an event. (a) ChangePointO

Which of the following is integer constants of TextEvent


30 class? TEXT_CHANGED

…………...is used to obtain the object that generated a


31 WindowEvent. ) getMethodO

32 32 MouseEvent is subclass of which of these classes? (a) ComponentEvent

33 ___ method is used to get x coordinate of the mouse. ) getXO


Which of these are constants defined in WindowEvent
34 class? ' WINDOW_ACTIVA
TED

35 __ is superclass of Window Event class. WindowEvent


Which of these packages contains all the event handling
36 interfaces? java.lang

When a component is added to a container which of these


37 interfaces handles the event? ) ComponentListener

38 38 __ interface define a method actionPerformedO ) ComponentListener

39 Which of the following interfaces define four methods? ComponentListener

40 __ interfaces define a method itemStateChangedO ) ComponentListener

Which method from the following methods will respond


41 when you click any button by mouse? a) mouseClickedO

42 ___ methods will be invoked if a character is entered (a) keyPressedO

43 __ methods is defined in MouseMotionAdapter class. (a) mouseDraggedO

Which of the constantts) from following constants is defined


44 in WindowEvent class? (a) WINDOW
_ACTIVATED

45 …………….is superclass of all Adapter classes (a) Applet

46 In Java, events are all the activities that occur between (a) The user
47 EventObject class belongs to : (a) java.util
The Component class is an abstract class and so its
48 _____ are used to create components. Subclasses

The A WT classes can be roughly categorized into the


49 GUI components
following groups:

50 Window is used for ……….. windows (a) Creating

The…………. interface is used to handle the menu events.


51 ) ContainerListener

(a) TextEvent(Object
52 The constructor that is defined by the Text Event class is : source, int
event_type)
53 ActionEvent,
The name of the event classes are :
ComponentEvent

Java packages such as support the Event


54 handling mechanism. ) Java.uti!

55 An event is generated when the internal state of the event


55 source is. _........ Not changed

56 EventObject class belongs to : Iava.util


The …………. interface is used to handle the menu
57 events. ContainerListener

58 The interface handles list events: ) ContainerListener

The event-
inheritance model
has replaced the
59 Which of the following are true? event-
delegation model.

60 Which of the following is the highest class in the event-


60 delegation model? java.util.EventListene
r

When two or more objects are added as listeners for the


(a) The first object
same event, which listener is first invoked to handle the
61 that was added as
event?
listener.

62 Which of the following components generate action events ? (a) Buttons

A TextField object
63 Which of the following are true? may generate an
ActionEvent.
The MouseListener
interface defines
methods for
64 Which of the following are true? handling mouse
clicks.

Suppose that you want to have an object "eh" to handle the


TextEvent of a TextArea object. How should you add eh as t.addTextListener(eh)
65
the event handler to it ? ;

What is the preferred way to handle an object's events in Override the object's
66 Java 2? handleEvent( )
method.

A component may
handle its own
events by adding
67 67 Which of the following are true? itself as an event
listener.

The event delegation model, introduced in release 1.1 of the


68 JDK, is fully compatible with the event ~odel. (a) True

A component subclass that has executed enableEvents( ) to


enable processing of a certain kind of event cannot also use
69 (a) True
an adapter as a listener for the same kind of event.

70 Receiving and
Till now, two models have been introduced in Java for:
Processing events
(c) java.event ) java.awt (d) java.awt.event D

An event is an An event is a
An event is an object
object that class used for
that describes any
describes a state defining object,
change by the A
change in to create'-
user and system.
processing. events.

(d)
(c) addKeyListener()addKistener() eventKeyboardLi C
stener()
(b) (c)
addMouseListener( addMouseMotionListne (d) eventMouseMotionListener C
) r()

A listener is a
A listener is a method
object that is
that is notified when
notified when an
an event None of the mentioned B
event
occurs.
occurs.

java.lang java.util (d) java.net B

(d) C
getIDO getEventO
getEventObjectO

(b) EventClass (c) ActionEvent (d) ItemEvent A


(b) ComponentEvent (c) AdjustmentEvent (d) WindowEvent C

(b) ComponentEvent (c) AdjustmentEvent (d) WindowEvent D

(d) A
(b) KeyEvent (c) WindowEvent
AdjustmentEvent

(b) (d)
getActionComman getActionEventComma getActionEvent() B
dO ndO

) All of the D
(c) SHIFT_MASK
mentioned

(b) B
(d) WindowEvent KeyEvent
AdjustmentEvent
(d)
(c) getAdjustmentTypeO
getEventTypeO getEventObjectT C
ypeO
(c) getAdjustmentValueO
getAdjustmentTypeO (d) getAdjustmentAmountO A

(b) ComponentEven(c) AdjustmentEvent (d) WindowEvent C

(b) BLOCK_INCR (c) UNIT_DECREMENT(d) UNIT_INCREMENT D

(c) FocusEvent (b) ContainerEvent (d) InputEvent A

(c) FocusEvent (b) ContainerEvent (d) InputEvent B

(b) getContainer getActionEventO (d) getContainerEventO D

(b) getchildO (e) getContainerCompo (d) getComponentChildO B

(b) (c)
COMPONENT_M COMPONENT_RESIZ , (d) All of the mentioned D
OVED E

(c) FocusEvent (b) ContainerEvent (d) InputEvent C

(c) ItemEvent (b) ContainerEvent (d) InputEvent A


(c) isTemporaryO (b) typeEventFocusO (d) isPermanent() C
(c) ItemEvent (b) ComponentEvent (d) InputEvent B
(d)
(c) getMouseXYO (b) getCoordinatesO getMouseCordina A
tesO
(d)
(b) TranslatePointO(c) ChangeCordinatesO TranslateCordinat B
esO

(b) TEXT_FORMAT_CHANGED
(c) TEXT_VALVE_CHANGED
(d) TEXT_SIZE_CHANGED C

(d)
(c) B
(b) getWindowO getWindowObjec
getWindowEventO
tO

(c) ltemEvent (b) ContainerEvent (d) InputEvent D


(c) A
(b) getXCoordinateO (d) getPointXO
getCoordinateXO
(b)
WINDOW_CLOS (c) WINDOW _DEICON(d) All ofthe mentioned D
ED
(c) ltemEvent (b) ComponentEvent (d) InputEvent B

(c) java.awt.event (b) java.awt (d) java.event C

(c) FocusListener (b) ContainerListener (d) InputListener B

(c) ActionListener (b) ContainerListener (d) InputListener C

(c) ActionListener (b) ContainerListener (d) InputListener A

(c) ActionListener (b) ContainerListener (d) ltemListener D

(d) All ofthe D


(c) mousePressedO (b) mouseEnteredO
mentioned

(c) keyTypedO (b) keyReleasedO (d) keyEnteredO C


(d) A
(b) mousePressedO (c) mouseReleasedO
mouseClickedO
(b)
(c) WINDOW (d) All of the D
WINDOW_CLOS
_DEICONIFIED mentioned
ED
(b) A
(c) Event (d) InputEvent
ComponentEvent
(d) None of the C
(b) The application (c) Both (a) and (b)
above
(b) java.awt (c) java.lang (d) java.sql A

(b) Superclasses (c) Both (a) and (b) (d) None of these. A

(c) Graphics tools (b) Layouts (d) All ofthese D

(b) Handling (c) Modifying (d) Both (a) and D


(b)

(c) ActionListener (b) FocusListener (d) Window C

(d) textevent
(b) textevent (c) textevent (object
(Object source, A
(Object source, int Source, float
string
event_type) event_type)
event_type)
(b) ContainerEvent, (c) ltemEvent, D
(d) All ofthese
FocusEvent KeyEvent

(c) Java.awt.event (b) Java.awt (d) All of these D

(c) Either changed B


(b) Changed ( d) None of
or not

(b) Java.awt (c) Java.lang (d) -Java.sql A

(d) C
(c) ActionListener (b) FocusListener
WindowListener

(d) D
(c) FocusListener (b) ltemListener
ActionListener

The event-
The event- The event-delegation
delegation
inheritance model model uses event
model uses the
is more efficient listeners to
handleEvent(
than the define the methods of C
method to
event-delegation event-handling
support event
model. classes.
handling.

(b)
(c) java.awt.A B
java.util.EventObje (d) java.awt.event.A WTEvent
WTEvent
ct

(d) It is
(c) There is no way to impossible to
(b) The last object determine which have more than
that was added as listener will be one listener for B
listener. invoked first. a
given event.

(b) Labels (c) Check boxes (d) Windows A


(b) A TextArea (d) A Menultem
(c) A Button object
object may object may (e) Option (a), (c) and E
may generate an
generate an generate an (d)
ActionEvent.
ActionEvent. ActionEvent.
The The
MouseMotionListe The ActionListener
ner interface MouseClickListener interface defines
defines methods interface defines methods for
) Option (a) and (d) E
for handling methods for handling the
mouse' clicks. handling mouse clicks. clicking of a
button.

(c)
addTextListener(eh (b) eh.add'l'extListener(t);
(d) addTextListener(t,eh A
.t);

(b) Add one or (d) Have the


more event object override its B
) Have the object override its processEvent( ) methods
listeners to handle dispatchEvent( )
the events. methods

A component may
handle its own
events by
overriding
A component may not handle
Optionits(a)
ownandevents
(b) D
its event-
dispatching
method.

(b) False B

(b) False B

(d) Modifying
(b) Deleting and (c) Receiving and A
and Receving
Processing events Deleting events
events
1 A set of rules that governs data communication
Which of this class is used to create servers that listen for
2 either local or remote client programs?

3 A ……….. is a program providing services to the - program.


4 …………...server can process multiple requests at a time.
Network programming needs information to be in the form
5 of ……. byte order.

6 Communication using TCP protodcol is ____ .and

7 9ommunication using UDP protocol is and __ .

__ is a server that is mediator between real web server


8 and client application.

9 SOCK_STREAM sockets are used by __ processes.


10 SOCK_DGRAM sockets are used by __ processes.
Which package contains classes and interfaces for
11 networking?

12 Port number of Telnet is_.


13 java.net package consist of interface __ .
is a protocol for breaking and sending packets to an
14 address across a network?

15 Full form ofDNS is _.


16 TCP is _ oriented protocol.
17 __ method is used to find the host of URL ?
18 __ class is used to encapsulate IP address and DNS.

Number of ports of TCPIIP are reserved for specific


19
protocols are __ .

20 In a single IP address __ bits are present.


21 Pretty good privacy (PGP) is used in security of __ .
22 A bundle of information passed between machines is called
23 URL stands for __ .
24 24 Exception is thrown by URL class's constructors is __ .
Which method is used to know the full URL of an URL
25 object?
Which class is used to access actual bits or content
26 information of a URL ?

27 __ thrown to indicate that the IP address of a host could not be determined


28 28 What are the types of factory pattern ?
29 Which class have only one instance?
A __ variable is shared by all instances of the class. It
30 exists even before an object is created.

31 __ is wrapper around everything associated with a


31 reply from an http server?

32 __ is a bundle of information passed between machines.


33 __ class is necessary to implement datagrams.
method of DatagramPacket is used to find the port
34
number.

Which of these tranfer protocol must be used so that URL


35 can be accessed by URLConnectioncIass object?

36 _ method is used to know when URL is last modified.


method is used to know the type of content used in
37 theURL.

38 Which package is used for handling security related issues in a program ?


Class which allows us to get real time data about private
39 and protected member of a class is_•

The packages contain classes and interfaces used for input


40 and output operations of a program is_•

41 class is not a member class of java.io package


42 -- interface is not a member ofjava.io package?
Which of this class is not related to input and output
43 stream in terms of functioning?

44 File object specifies __ .


Which method is used for testing whether the specified
45 element is a file or not?

46 The security policy is encapsulated by the Policy class:


47 To create a policy class
To return the currently installed policy object __
48 method is used.
A __ is responsible for determining whether code
executing in the Java runtime environment has permission
49
to perform a security-sensitive operation.

50 Permission class is a part of __ package


51 51 Which of following are sub classes of permission class?
Protocols (b) Standards (c) RFCs (d) Functions

(a) HttpServer (b) MimeHeader (c) HttpResponse (d) ServerSockets

Server, Client (c) Server, Server (b) Client, Server (d) Host, Client
An iterative (b) A concurrent (c) A concurrent or an iterative (d) None ofthese

(a) host (b) network (c) client (d) server

(d) connection-
connectionless, iterative (b) connectionless, concurrent (c) connection-oriented, iterative oriented,
concurrent
(d) connection-
connectionless, iterative (b) connectionless, concurrent (c) connection-oriented, iterative oriented,
concurrent

a) Host (b) HTTP (c) Proxy ( d) Web

(a) TCP ( b) UDP (c) SCTP (d) FTP


(a) TCP ( b) UDP (c) SCTP (d) FTP

(b) java.util (c) java.net (d)


) java.io
java.network

a) 21 (b) 23 (c) 25 (d) 79


ContentHandler Factory. (b) SocketImplfactory (c) SocketOption (d) All of above

(d) Proxy
TCIP/lP (c) Socket (b) DNS
Server
(d) Domain
) Data Network Service (b) Data Name Service (c) Domain Network Service
Name System
stream (b) message (c) block (d) segment
gethostO (b) GetHostO (c) GethostO (d) getHostO
(a) DatagramPacket ( b) URL (c) InetAddress (d) Socket

a) 108 (c) 255 (b) 1024 (d) 512

a) 8 (b) 16 (c) 32 (d) 64


a) browser (b) email (c) FTP (d) website
Protocol (c) DatagramSocke ) Cache (d) Datagrams
Uniform Resource Locator (b) Uniform Resource Latch (c) Universal Resource Locator (d) Universal Resource Latch
(d)
URLNotFound (b) URLSourceNotFound (c) MalformedURLException
URLException

fullHostURLO (b) getHostURLO (c) ExternalFormO (d) toExternalFormO


(d) All of the
URL (c) URLConnection URLDecoder
mentioned

UnknownHostException (b) IOException (c) HostNotFoundException (d) None ofthese


(b) Abstract Method (c) All of the above (d) None ofthe
) Factory Method
above
(a) Adaptor Class (b) Singleton Class (c) Factory class (d) Proxy Class

(a) abstract (b) instance (c) interface (d) static

HTTP (d) httpserver (b) HttpResponse (c) Httpserver

(a) Protocol (b) Cache (c) Datagrams (d) Segment


(b) DatagramSocket (c) Datagram ( d) Both (a) and
) DatagramPacket
(b)

a) portO (c) GetPortO (b) getPortO (d) findPortO

(d) None of the


(a) http (c) URL (b) https
mentioned

(a) LastModifiedO (b) getLastModifiedO (c) getlastModifiedO (d) GetLastModifiedO


(d)
ContenttypeO (b) contentTypeO (c) getContentTypeO GetContentType
O
(b) java.lang.security (c) java.awt.im~e (d)
(a) java.security
java.io.security
(d)
) java.io.security (b) java.Getlnformation (c) ReflectPermission MembersPermis
sion

java.util (b) java.lang (c) java.io (d) java.file.io

(a) File (b) StringReader (c) Writer (d) String


(a) DataInput (b) ObjectInput (c) ObjectFilter (d) FileFilter

(a) File (b) Writer (c) InputStream (d) Reader

(a) • file in disk (b) directory path (c) file/directory on disk (d) file in folder

(a) IsDirectory() (b) isFileO (c) IsfileO (d) isfilesO

(d)
(a) java.security.Policy (b) java.policy.security (c) java.plicy
java.security
(d) Public
(a) public Create Policyt) (b) public PolicyO (c) protected policyi)
policyt)
(b) public static Policy
public Policy getPolicy() (c) public Policy getPolicy() (d) public static Policy getPolicy()
GetPolicyO
(b) security class (c) policy object (d) policy
(a) security object
method

java.security (b) java.lang.Object (c) java.permission.security (d) java.security.Permission


(b) FilePermission (c) ServicePermission (d) All ofthe
a) AllPermission
above
A

ServerSockets D

A
None ofthese B

A
B

B
D

D
A
D
C

C
B
D
Universal Resource Latch A
C

toExternalFormO D
D

None ofthese A
C
B

C
D

GetLastModifiedO B

D
C

A
B

D
public static Policy getPolicy()
C

ava.security.Permission D
D
included in java
1 Import java.sql. *;
program to establish database connectivity using JDBC

URL or machine name where


DrivezManager.getflonnectiont , __ ,
server runs, Password,
2 What are the two parameters that are included?
User ID

3 Which ofthe following invokes stored procedures in sql ? ) Prepared statements

Which of the following function is used to find the column


4 count of the particular resultset ? getMetaDataO

Preparedstatement object in JDBC IS used to execute


5 ____ queries. executable

In JDBC imports all Java classes concerned with


6 database connectivity. (a) javax.sql."

Which type of driver converts JDBC calls into the network


protocol used by the database management system
7 ) Type 1 driver
directly?

By invoking the method


get(. .. , String type)on the
8 How can you retrieve information from a ResultSet ? ResultSet, where type is the
database type

Yes, but only if you call the


method openCursor() on
the ResultSet, and if the
9 Are ResultSets update able ? driver and database support
this option

10 What is JDBC ? java compiler


JDBC is a………….. interface, which means that it is used
11 to invoke SQL commands directly low-level

Kind of driver converts JDBC calls on the client API for


,
12 Oracle, Sybase, Informix, DB2, or other DBMS is known JDBC-Net pure Java driver
as, _
Which JDBC driver Type(s) can be used in either applet or
13 servlet code? Both Type 1 and Type 2

What MySQL property is used to create a surrogate key in


14 MySQL? UNIQUE

15 ODBC minimum SQL grammar contains _ INSERT, UPDATE, DELETE


only
16 Type 1 driver is also known as ---- JDBC-Native API
ODBC requires configuring as…………... which represents
17 the target database. ) Data Source Name (

18 Type 2 driver is also known as ---- JDBC-Native API


…………..calls get converted into native C or C++ API
19 calls. API

Which of the following translates the socket information in


20 call format required by the DBMS? Application server

The JDBC API is an application interface of java for


21 connecting java as, _ ___ Front End

22 What is backend ? a) DB

Which of the following model is java applet or application


23 directly Communicates with data source? ) Three tier

24 The type of the network can be an intranet


25 ____ interface is important from java.sql package in JDBC. (a) Statement
Connection interface helps by providing the different
26 methods for and _ Transactions

Which of the following class IS used for establishing


27 Driver manager
connection ?

JDBC driver manager is known as the of the


28 JDBC architecture. front end (

32 Every driver must provide a class that should implement


29 the _ Driver interface
Which of the following method is used to load and register
30 driver? Class.forN ame("sun.odbc.jdbc.J
dbcOdbcDriver")

31 Which of the following is used for sending SQL statements? Statement

Which of the following is used for calling procedures on


32 database? Statement

33 ………….. interface allows storing results of query ? Statement


34 getUserNameO method is used to _ ___ ) retrieve name of user
35 Which of the following query is used for SELECT query ? executeO;
(b) Import java.sql.odbc.jdbc. *; (c) Import java.jdbc. *; (d) Import java.sql.jdbc

URL or machine name where User ID, Password, URL or Password, URL or machine name
server runs, User ID, machine name where where server runs,
Password. server runs User IDView.

(b) Connection statement (c) Callable statements (d) All ofthe mentioned

(b) MetadataO (c) getColumnCountO (d) getCountO

(b) simple (c) high level (d) parameterized

(b) java.mysql.* (c) java.sql.* (d) COIJl.*

(b) Type 2 driver (c) Type 3 driver (d) Type 4 driver

By invoking the method get(. .. , By invoking the special getter


Type type)on the By invoking the method methods on the
ResultSet, where Type is an getValue(. .. ), and cast the ResultSet:
object which represents a result to the desired Java type. getString( ... ),getBoolean (. .. ),
database type getClob(. .. ),

No, ResultSets are never


Yes, but only if you indicate a Yes, but only if the ResultSet is an updateable. You must
concurrency strategy object of class explicitly ex~cute DML statements
when executing the statement, UpdateableResultSet, and if the (i.e. insert, delete
and if the driver and driver and database and update) to change the data in
database support this option support this option the underlying
database.

(c) Java interpreter (b) Java API (d) Both (a) and (b

(b) middle-level (c) higher-level (d) user

(b) JDBC-ODBC Bridge plus ODBC


(c) Native-API partly-Java driver (d) Both (a) and (b)
driver
(b) Both Type 1 and Type 3 (c) Both Type 3 and Type 4 (d) Type 4 only

SEQUENCE AUTO_INCREMENT None of the mentioned

(b) Stored procedure (c) date, time and timestamp only (d) CREATE and DROP VIEW only

(b) JDBC-ODBC Bridge Driver (c) JDBC-net pure java (d) N one of these

b) Domain Name (c) Data source (d) Source name

(b) JDBC-ODBC Bridge Driver (c) JDBC-net pure java (d) None of these

(b) JDBC (c) JDBC API (d) None of

(b) Middleware application server (c) Server (d) Middleware

(c) Backend (b) Middle (d) None of

(b) DBMS (c) DBC (d) None of these

(b) N-tier (c) Two tier (d) None of these

(b) an extranet (c) LAN (d) none ofthese


(b) Result (c) Connection ( d) None of these

(c) Error handling ) Connection (d) Both (a) and

(b) Connection (c) Statement (d) Resultset

b) middle layer (c) backbone (d) None of these

(b) Driver manager (c) Driver class (d) Driver


(b)
Class.forName("sun.jdbc.odbc.JdbcO (c) Class.forN ame("sun.jdbc.odbc.J (d) Class.forN ame("sun.jdbc.odbc")
dbcDriver") dbcOdbcDriver")

(b) Callable statement (c) Both (a) and (b) (d) None ofthese

(b) Callable statement (c) Prepared statement (d) None of these

(b) Connection (c) Resultset (d) None of these


(b) retrieve name (c) access name (d) None of these
(b) execute(String sql); (c) executeUpdate(String sql); (d) executeQuery(String sql);
1 What JSP stand for __ . Java Server Pages

The Java………….. specification defines an application


programming interface for communication between the
2 (a) Server
Web server and the application program.

. 3 The doGetO method extracts values of the parameter's


type
3 request.getParameterO
and number by using _

4 4 When a JSP page is compiled, it turns into what (a) Applet

5 What programming language(s) or scripting language(s)


5 does Java Server Pages (JSP) support ? (a) VBScript only

6 What is byte code? (a) Machine-specific code

7 Where is metadata stored ? In the MySQL database metadata


8 Which of the following is not true for servlet ? a) It is persistent

Which JSP tag is used to transfer processing to another


9 JSP page? (a) <jsp:include> (

Which of the following is an approach for state


10 maintenance in Web applications? (a) Hidden Form Field

11 Which is least visibility scope for Java bean in JSP? (a) Page
Which of the following is/are true for JSP technology ? 1. It is
persistent.
12 II. Platform independent. (a) Only (I) above .
III. Browser executes the code.

13 Which method of the request object is used to extract


13 values of the input fields in a form when it is submitted ? (a) getParameter

Which of the following is not a standard method called as


14 part of the JSP life cycle? (a) jsplnitO

If you want to override a JSP file's initialization method,


15 within what type of tags must you declare the method (a) <@ @>
Which of the following cannot be used as the scope when
16 using a JavaBean with JSP ? (a) Application

17 What JSP is basically used today? (a) To make controller

18 (a) page, request, session,


Choose correct scopes into JSP :
application
19 19 Choose correct syntax of directive: a) <o/o@ directive_name %>

Which of the following are interface 1. ServletContext 2. Servlet


20 3. GenericServlet 4. HttpServlet (a) All (1), (2), (3) and (4)

Which of the following methods are main methods in life


cycle of servlet? 1. initO 2. serviceO
3. destroy() 4. stop()
21 a) All (1), (2), (3), (4) and (5)
5. waitO

During initialization of servlet, a servlet instance can


22 throw (a) An UnavailableException

Java servlets are efficient and powerful solution for


23 creating _ for the web. (a) dynamic content

24 __ is the first phase of the servlet life cycle. (a) Initialization

The service phase of the servlet life cycle represents all


25 interactions with requests until the servlet is __ . (a) created

26 The difference between Servlets and JSP is the __ . (a) translation


(b) Java Server Programming (c) Java Service Pages (d) Java Service Programming

(b) Servlet (c) Program (d) Randomize

(b) request.setParameterO (c) response.getParameterO (d) response.getAttributeO

(b) Servlet (c) Application (d) Mallet

(b) -Iscript only (c) Java (d) None of the above.

(b) Java code (c) Machine-independent code (d) None ofthe above is correct
(c) In the MySQL database
(b) In the MySQL database metasql (d) None ofthe mentioned
mysql
(b) Platform independent (c) High performance (d) It is multi threaded

b) <jsp.forward» (c) <jsp.redirect» (d) <jsp:useBean>

(b) URL Rewriting (c) Cookies (d) HTl'P Session

(b) Session (c) Request (d) Application

(c) Both (I) and (II) above (d)


(b) Only (II) above (e) All (I), (II) and (III) above.
Both (II) and (III) above

(b) getParameterNames (c) getValues (d) putValues

(b) jspServiceO (c) jspServiceO (d) jspDestroyO

(b) <o/o@ %> (c) <% %> (d) <%! %>


(b) Session (c) Request (d) Response

(b) To develop server pages (c) In writing business logic


(d) None
(d) Deprecated
(b) Page, response, session, (c) Page, request, response,
(d) None
application session
(b) <% directive_name %> (c) <o/o@ directive_name @%> (d) None

(b) Only (1) and (2) (c) Only (1), (3) and (4) (d) Only (1) and (4)

(c) Only (3), (4) and (5) (b) Only (1), (2) and (3) (d) Only (1), (4) and (5)

(b) A ServletException (c) Both (a) and (b) (d) None

(b) static content (c) hardware (d) both (a) and (b)

(b) Service (c) Destruction (d) Both (a) and (b)

(b) running (c) initiated (d) destroyed

(b) compilation (c) syntax (d) both (a) and (b)


(e) It is single threaded.

(e) <jsp:use:include>.

(e) All of the above.

(e) Global.

(e) getParameters.
(e) Page

You might also like