Advanced Java MCQ
Advanced Java MCQ
Strictly as per new revised syllabus of ‘I’ Scheme w.e.f. academiic year 2018-2019
Advanced
d Java Program
mming
(Code : 22517)
Semester V - Computer Engineering Program Group(CO/CM/CW)
O
Ravi Majithia
Free MCQ Bo
ooklet for Online Exam
mination
Features
MSBTE
More than 250 MCQ’s.
Chapterwise Multiple Cho
oice Questions Given.
Specially for online Examin
n ation as per ‘I’ Schemes
10 0
10 0
Index of MCQ’s
Unit - I
Unit - II
Unit - III
Unit - IV
Unit - V
Unit - VI
10 0
10 0
1 Abstract Windowing Toolkit (AWT)
Unit I
Q. 1 GivetheabbreviationofAWT? Q. 8 HowmanytypesofcontrolsdoesAWTsupports
(a) AppletWindowingToolkit thesecontrolsaresubclassesofcomponent?
(b) AbstractWindowingToolkit (a) 7 (b) 6
(c) AbsoluteWindowingToolkit (c) 5 (d) 8
(d) Noneoftheabove Q. 9 Whicharepassivecontrolsthatdonotsupportany
Q. 2 Whichisthecontainerthatcontaintitlebarand interactionwiththeuser?
canhaveMenuBars.Itcanhaveothercomponents (a) Choice (b) List
likebutton,textfieldetc.? (c) Labels (d) Checkbox
(a) Panel (b) Frame
Q. 10 BywhichmethodYoucansetorchangethetextin
(c) Window (d) Container aLabel?
Q. 3 WhichisacomponentinAWTthatcancontain (a) setText() (b) getText()
anothercomponentslikebuttons,textfields,labels (c) BothA&B (d) Noneoftheabove
etc.?
Q. 11 Whichclassisusedtocreateapop‐uplistofitems
(a) Window (b) Container fromwhichtheusermaychoose?
(c) Panel (d) Frame (a) List (b) Choice
Q. 4 AWTisusedforGUIprogramminginjava? (c) Labels (d) Checkbox
(a) True Q. 12 Whichobjectcanbeconstructedtoshowany
(b) False numberofchoicesinthevisiblewindow?
Q. 5 Whichclassprovidesmanymethodsforgraphics (a) Labels (b) Choice
programming? (c) List (d) Checkbox
(a) java.awt Q. 13 Whichisusedtostoredataandpartialresults,as
(b) java.Graphics wellastoperformdynamiclinking,returnvalues
(c) java.awt.Graphics formethods,anddispatchexceptions?
(d) Noneoftheabove (a) Window (b) Panel
Q. 6 ThesetwowaysareusedtocreateaFrame (c) Frame (d) Container
BycreatingtheobjectofFrameclass(association) Q. 14 Thefollowingwayisusedtocreateaframeisby
ByextendingFrameclass(inheritance) creatingtheobjectofFrameclass?
(a) True (a) inheritance
(b) False (b) association
Q. 7 Whichisthecontainerthatdoesn'tcontaintitle (c) BothA&B
barandMenuBars.Itcanhaveothercomponents (d) Noneoftheabove
likebutton,textfieldetc?
Q. 15 AWTmorepowerfulcomponentsliketables,lists,
(a) Window scrollpanes,colorchooser,tabbedpaneetc.?
(b) Frame (a) True (b) False
(c) Panel
(d) Container
10 0
Advanced Java Programming (MSBTE) M1-2 MCQ - Abstract Windowing Toolkit (AWT)
10 0
Advanced Java Programming (MSBTE) M1-3 MCQ - Abstract Windowing Toolkit (AWT)
10 0
Advanced Java Programming (MSBTE) M1-4 MCQ - Abstract Windowing Toolkit (AWT)
10 0
Advanced Java Programming (MSBTE) M1-5 MCQ - Abstract Windowing Toolkit (AWT)
Answers
Q.1 (b) Q.2 (b) Q.3 (b) Q.4 (a) Q.5 (c) Q.6 (a) Q.7 (c) Q.8 (a)
Q.9 (c) Q.10 (a) Q.11 (b) Q.12 (c) Q.13 (c) Q.14 (b) Q.15 (a) Q.16 (b)
Q.17 (b) Q.18 (a) Q.19 (a) Q.20 (c) Q.21 (d) Q.22 (c) Q.23 (a) Q.24 (c)
Q.25 (c) Q.26 (b) Q.27 (b) Q.28 (a) Q.29 (a) Q.30 (a) Q.31 (c) Q.32 (d)
Q.33 (c) Q.34 (b) Q.35 (c) Q.36 (d) Q.37 (a) Q.38 (c) Q.39 (b) Q.40 (d)
Q.41 (c) Q.42 (b) Q.43 (d) Q.44 (d) Q.45 (c) Q.46 (a) Q.47 (b) Q.48 (a)
Q.49 (d) Q.50 (c) Q.51 (b) Q.52 (d) Q.53 (c) Q.54 (d) Q.55 (c) Q.56 (b)
Q.57 (c) Q.58 (b) Q.59 (c) Q.60 (c) Q.61 (c) Q.62 (c) Q.63 (a) Q.64 (c)
10 0
2 Swings
Unit II
Q.8 Whichpackageisusedforimporingswing
Q.1 Thefollowingspecifiestheadvantagesof components?
Itislightweight. (a) java.swing (b) javax.swing
Itsupportspluggablelookandfeel. (c) java.awt. (d) Alloftheabove
ItfollowsMVC(ModelViewController)
architecture. Q.9 Inswing,Buttonsaresubclassesofwhichclass?
(a) Swing (b) AWT (a) AbstractButton (b) JButton
(c) BothA&B (d) Noneoftheabove (c) Button (d) JRadioButton
10 0
Advanced Java Programming (MSBTE) M2-2 MCQ - Swings
Answers
Q.1 (a) Q.2 (b) Q.3 (b) Q.4 (a) Q.5 (c) Q.6 (c) Q.7 (b) Q.8 (b)
Q.9 (a) Q.10 (d) Q.11 (b) Q.12 (c) Q.13 (c) Q.14 (d) Q.15 (a) Q.16 (c)
10 0
3 Event Handling
Unit III
10 0
Advanced Java Programming (MSBTE) M3-2 MCQ - Event Handling
10 0
Advanced Java Programming (MSBTE) M3-3 MCQ - Event Handling
Answers
Q.1 (c) Q.2 (d) Q.3 (c) Q.4 (d) Q.5 (b) Q.6 (c) Q.7 (a) Q.8 (b)
Q.9 (c) Q.10 (b) Q.11 (a) Q.12 (d) Q.13 (d) Q.14 (d) Q.15 (b) Q.16 (d)
Q.17 (a) Q.18 (d) Q.19 (d) Q.20 (d) Q.21 (d) Q.22 (a) Q.23 (d) Q.24 (d)
Q.25 (b) Q.26 (d) Q.27 (c) Q.28 (c) Q.29 (a) Q.30 (d) Q.31 (d) Q.32 (c)
Q.33 (b) Q.34 (b) Q.35 (d) Q.36 (c) Q.37 (d) Q.38 (a) Q.39 (a)
10 0
4 Networking Basics
Unit IV
10 0
Advanced Java Programming (MSBTE) M4-2 MCQ - Networking Basics
10 0
Advanced Java Programming (MSBTE) M4-3 MCQ - Networking Basics
Answers
Q.1 (b) Q.2 (b) Q.3 (d) Q.4 (c) Q.5 (d) Q.6 (d) Q.7 (d) Q.8 (d)
Q.9 (c) Q.10 (c) Q.11 (a) Q.12 (c) Q.13 (d) Q.14 (b) Q.15 (a) Q.16 (d)
Q.17 (b) Q.18 (a) Q.19 (b) Q.20 (c) Q.21 (b) Q.22 (a) Q.23 (d) Q.24 (a)
Q.25 (b) Q.26 (c) Q.27 (d) Q.28 (b) Q.29 (b) Q.30 (d) Q.31 (d) Q.32 (a)
Q.33 (a) Q.34 (b) Q.35 (b) Q.36 (b) Q.37 (a) Q.38 (d)
10 0
5 Interacting with Database
Unit V
Q.7 Native–protocolpureJavaDriverconverts
Q.1 The__________packagecontainsclassesthat _______intothe_________directly.
helpinconnectingtoadatabase,sendingSQL (a) JDBCcalls,networkprotocol
statementstothedatabaseandprocessthequery (b) ODBCclass,networkprotocol
request. (c) ODBCclass,usercalls
(a) connection.sql (b) db.sql (d) JDBCcalls,usercalls
(c) pkg.sql (d) java.sql
Q.8 ChoosethecorrectsyntaxforgetConnection()
Q.2 WhichofthefollowingisnotatypeofJDBC method.
driver? (a) publicstaticConnectiongetConnection(String
(a) 100%pureJavaDriver url,Stringpassword)throwsSQLException
(b) JDBC–netpureJavaDriver (b) publicstaticConnectiongetConnection(String
(c) JDBC–NativeAPIdriver name,Stringpassword)throwsSQLException
(d) JDBC–NativepureJavaDriver (c) publicstaticConnectiongetConnection(String
url,Stringname,Stringpassword)throws
Q.3 InJDBC______________importsallJavaclasses SQLException
thatareconcernwithDatabaseconnectivity.
(d) publicstaticConnectiongetConnection(String
(a) javax.sql (b) java.mysql url,Stringname)throwsSQLException
(c) java.sql (d) com.sql
Q.9 SQLstandsfor__________.
Q.4 DatabaseprogrammingusingJavathrowswhichof (a) StructuredQueryLanguage
thefollowingexception?
(b) SequentialQueryLanguage
(a) SQLException
(c) StructuredQuestionLanguage
(b) ClassNotFoundException
(d) SequentialQuestionLanguage
(c) Noneofthese
(d) Bothofthese Q.10 _____________isatableofdatawhichrepresents
adatafromtable.
Q.5 Inthebelowstatement,whichtypeofquerycan (a) MetaData (b) ResultSetMetaData
beusedwithexecuteUpdate()method.
statement.executeUpdate(queryhere) (c) ResultSet (d) Statement
(a) Insert,Update,Delete Q.11 PublicclassDriverManagerextends____________
(b) Insert,Select,Delete (a) Object (b) String
(c) OnlySelect (c) Connection (d) Statement
(d) AnyQuery
Q.12 Whichofthefollowingmethodissupportedby
Q.6 Whatispurposeofnext()method? Statementinterface?
(a) toretainthenextelementinaseries. (a) publicbooleanexecute(Stringquery)
(b) toretainnexttable. (b) publicResultSetexecuteQuery(Stringquery)
(c) toretainnextrecordinaseries. (c) publicintexecuteUpdate(Stringquery)
(d) Noneoftheabove (d) Allofabove
10 0
Advanced Java Programming (MSBTE) M5-2 MCQ - Interacting with Database
10 0
Advanced Java Programming (MSBTE) M5-3 MCQ - Interacting with Database
Answers
Q.1 (d) Q.2 (d) Q.3 (c) Q.4 (d) Q.5 (a) Q.6 (c) Q.7 (d) Q.8 (c)
Q.33(b)
10 0
6 Servlets
Unit VI
(a) request.addCookie(newCookie(“username”,
Q.1 JSPembeds__________in___________.
“joe));
(a) Servlet,HTML (b) HTML,Java
(b) response.addCookie(newCookie(“username”,
(c) HTML,Servlet (d) Java,HTML
“joe”))
Q.2 WhichofthefollowingisthedefaultHttpRequest (c) request.addCookie(“username”,“joe);
method? (d) request.addCookie(“username”,“joe);
(a) doGet() (b) doPost()
Q.7 WhichJSPtagisusedtotransferforprocessing
(c) doTrace() (d) doPut()
anotherJSPpage?
Q.3 Whicharetrueabouttaglibrariesinweb (a) <jsp:include> (b) <jsp:forward>
application? (c) <jsp:useBean> (d) <jsp:use:include>
(a) packagedinthe/WEB‐INFdirectoryorsub‐
directoryoftheWARfile Q.8 Anapplicationwantstoinvalidatethesessionboth
programmaticallyanddeclaratively.Selectthe
(b) Ifatagisimplementedasatagfileand
bestmatchtodothis.
packagedin/WEB‐INF/tags/orasub‐
directory,aTLDwillbegenerated (a) httpRequest.getSession().end()
automaticallybythewebcontainer,though, <session‐config><session‐timeout‐interval>
youcanprovideoneifyouwish time_in_minutes</session‐timeout‐interval>
(c) packagedinthe/META‐INF/directoryorsub‐ </session‐config>
directoryofataglibrarypackagedinajar. (b) httpRequest.getSession().invalidate()
(d) Alloftheabove. <session‐config><session‐timeout>
time_in_minutes</session‐timeout>
Q.4 Namethehttpmethodusedtosendresourcesto </session‐config>
theserver.
(c) httpRequest.getSession().close()
(a) FTPmethod (b) PUTmethod
<session‐config><session‐timeout>
(c) WRITEmethod (d) COPYmethod time_in_minutes</session‐timeout>
Q.5 IdentifythepropersyntaxofdoGet(). </session‐config>
(a) voiddoGet(HttpResponseres,HttpRequest (d) httpRequest.getSession().invalidate()
req)throwsIOException,ServletException <session‐config><session‐duration>
(b) voiddoGet(HttpRequestreq,HttpResponse time_in_minutes</session‐duration>
res)throwsIOException,ServletException </session‐config>
(c) voiddoGet(HttpResponseres)throws Q.9 Theinclude()methodinRequestDispatcher____.
IOException,ServletException (a) sendsarequesttoanotherresourcelike
(d) voiddoGet(HttpRequestreq)throws servlet,JSPorhtml.
IOException,ServletException
(b) includesresourcesoffilelikeservlet,JSPor
Q.6 GivenanHttpServletRequestrequestand html.
HttpServletResponseresponseinstances.Which (c) appendstherequestandresponseobjectsto
setsacookie“username”withthevalue“joe”ina thecurrentservlet.
servlet? (d) Noneofthese
10 0
Advanced Java Programming (MSBTE) M6-2 MCQ - Servlets
10 0
Advanced Java Programming (MSBTE) M6-3 MCQ - Servlets
Answers
Q.1 (d) Q.2 (a) Q.3 (d) Q.4 (b) Q.5 (b) Q.6 (b) Q.7 (b) Q.8 (b)
Q.33(d)
10 0
Note
10 0