Advanced Java MCQ Min PDF
Advanced Java MCQ Min PDF
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 - Computerr Engineering Program Group(CO
O/CM/CW)
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
nation as per ‘I’ Schemes
Index of MCQ’s
Unit - I
Unit - II
Unit - III
Unit - IV
Unit - V
Unit - VI
Unit I
Q. 1 Give the abbreviation of AWT ? Q. 8 How many types of controls does AWT supports
(a) Applet Windowing Toolkit these controls are subclasses of component?
(b) Abstract Windowing Toolkit (a) 7 (b) 6
(c) Absolute Windowing Toolkit (c) 5 (d) 8
(d) None of the above Q. 9 Which are passive controls that do not support any
Q. 2 Which is the container that contain title bar and interaction with the user?
can have MenuBars. It can have other components (a) Choice (b) List
like button, textfield etc.? (c) Labels (d) Checkbox
(a) Panel (b) Frame Q. 10 By which method You can set or change the text in
(c) Window (d) Container a Label ?
Q. 3 Which is a component in AWT that can contain (a) setText() (b) getText()
another components like buttons, textfields, labels (c) Both A & B (d) None of the above
etc.?
Q. 11 Which class is used to create a pop‐up list of items
(a) Window (b) Container from which the user may choose?
(c) Panel (d) Frame (a) List (b) Choice
Q. 4 AWT is used for GUI programming in java? (c) Labels (d) Checkbox
(a) True Q. 12 Which object can be constructed to show any
(b) False number of choices in the visible window?
Q. 5 Which class provides many methods for graphics (a) Labels (b) Choice
programming? (c) List (d) Checkbox
(a) java.awt Q. 13 Which is used to store data and partial results, as
(b) java.Graphics well as to perform dynamic linking, return values
(c) java.awt.Graphics for methods, and dispatch exceptions?
(d) None of the above (a) Window (b) Panel
Q. 6 These two ways are used to create a Frame (c) Frame (d) Container
By creating the object of Frame class (association) Q. 14 The following way is used to create a frame is by
By extending Frame class (inheritance) creating the object of Frame class?
(a) True (a) inheritance
(b) False (b) association
Q. 7 Which is the container that doesn't contain title (c) Both A & B
bar and MenuBars. It can have other components (d) None of the above
like button, textfield etc?
Q. 15 AWT more powerful components like tables, lists,
(a) Window
scroll panes, color chooser, tabbed pane etc.?
(b) Frame
(a) True (b) False
(c) Panel
(d) Container
Advanced Java Programming (MSBTE) M1-2 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)
Unit II
Q. 8 Which package is used for imporing swing
Q. 1 The following specifies the advantages of components?
It is lightweight. (a) java.swing (b) javax.swing
It supports pluggable look and feel. (c) java.awt. (d) All of the above
It follows MVC (Model View Controller)
architecture. Q. 9 In swing, Buttons are subclasses of which class?
(a) Swing (b) AWT (a) AbstractButton (b) JButton
(c) Both A & B (d) None of the above (c) Button (d) JRadioButton
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)
Unit III
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)
4 Networking Basics
Unit IV
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)
5 Interacting with Database
Unit V
Q. 7 Native – protocol pure Java Driver converts
Q. 1 The __________ package contains classes that _______ into the _________ directly.
help in connecting to a database, sending SQL (a) JDBC calls, network protocol
statements to the database and process the query (b) ODBC class, network protocol
request. (c) ODBC class, user calls
(a) connection.sql (b) db.sql (d) JDBC calls, user calls
(c) pkg.sql (d) java.sql
Q. 8 Choose the correct syntax for getConnection( )
Q. 2 Which of the following is not a type of JDBC method.
driver? (a) public static Connection getConnection(String
(a) 100% pure Java Driver url, String password) throws SQLException
(b) JDBC – net pure Java Driver (b) public static Connection getConnection(String
(c) JDBC – Native API driver name, String password) throws SQLException
(d) JDBC – Native pure Java Driver (c) public static Connection getConnection(String
url, String name, String password) throws
Q. 3 In JDBC ______________ imports all Java classes
SQLException
that are concern with Database connectivity.
(d) public static Connection getConnection(String
(a) javax.sql (b) java.mysql
url, String name) throws SQLException
(c) java.sql (d) com.sql
Q. 9 SQL stands for __________.
Q. 4 Database programming using Java throws which of
(a) Structured Query Language
the following exception?
(b) Sequential Query Language
(a) SQLException
(c) Structured Question Language
(b) ClassNotFoundException
(d) Sequential Question Language
(c) None of these
(d) Both of these Q. 10 _____________ is a table of data which represents
a data from table.
Q. 5 In the below statement, which type of query can
(a) MetaData (b) ResultSetMetaData
be used with executeUpdate( ) method.
(c) ResultSet (d) Statement
statement.executeUpdate(query here)
(a) Insert, Update, Delete Q. 11 Public class DriverManager extends ____________
(b) Insert, Select, Delete (a) Object (b) String
(c) Only Select (c) Connection (d) Statement
(d) Any Query Q. 12 Which of the following method is supported by
Q. 6 What is purpose of next( ) method? Statement interface?
(a) to retain the next element in a series. (a) public boolean execute(String query)
(b) to retain next table. (b) public ResultSet executeQuery(String query)
(c) to retain next record in a series. (c) public int executeUpdate(String query)
(d) None of the above (d) All of above
Advanced Java Programming (MSBTE) M5-2 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)
6 Servlets
Unit VI
(a) request.addCookie(new Cookie(“username” ,
Q. 1 JSP embeds __________ in ___________.
“joe));
(a) Servlet, HTML (b) HTML, Java
(b) response.addCookie(new Cookie(“username” ,
(c) HTML, Servlet (d) Java, HTML
“joe”))
Q. 2 Which of the following is the default HttpRequest (c) request.addCookie(“username” , “joe);
method? (d) request.addCookie(“username” , “joe);
(a) doGet( ) (b) doPost( )
Q. 7 Which JSP tag is used to transfer for processing
(c) doTrace( ) (d) doPut( )
another JSP page?
Q. 3 Which are true about tag libraries in web (a) <jsp:include> (b) <jsp:forward>
application? (c) <jsp:useBean> (d) <jsp:use:include>
(a) packaged in the /WEB‐INF directory or sub‐
directory of the WAR file Q. 8 An application wants to invalidate the session both
programmatically and declaratively. Select the
(b) If a tag is implemented as a tag file and
best match to do this.
packaged in /WEB‐INF/tags/ or a sub‐
directory, a TLD will be generated (a) httpRequest.getSession( ).end( )
automatically by the web container, though, <session‐config><session‐timeout‐interval>
you can provide one if you wish time_in_minutes </session‐timeout‐interval>
(c) packaged in the /META‐INF/ directory or sub‐ </session‐config>
directory of a tag library packaged in a jar. (b) httpRequest.getSession( ).invalidate( )
(d) All of the above. <session‐config><session‐timeout>
time_in_minutes </session‐timeout>
Q. 4 Name the http method used to send resources to </session‐config>
the server.
(c) httpRequest.getSession( ).close( )
(a) FTP method (b) PUT method
<session‐config><session‐timeout>
(c) WRITE method (d) COPY method time_in_minutes </session‐timeout>
Q. 5 Identify the proper syntax of doGet( ). </session‐config>
(a) void doGet(HttpResponse res,HttpRequest (d) httpRequest.getSession( ).invalidate( )
req) throws IOException, ServletException <session‐config> <session‐duration>
(b) void doGet(HttpRequest req,HttpResponse time_in_minutes </session‐duration>
res) throws IOException, ServletException </session‐config>
(c) void doGet(HttpResponse res) throws Q. 9 The include( ) method in RequestDispatcher ____.
IOException, ServletException (a) sends a request to another resource like
(d) void doGet(HttpRequest req) throws servlet, JSP or html.
IOException, ServletException (b) includes resources of file like servlet, JSP or
Q. 6 Given an HttpServletRequest request and html.
HttpServletResponse response instances. Which (c) appends the request and response objects to
sets a cookie “username” with the value “joe” in a the current servlet.
servlet? (d) None of these
Advanced Java Programming (MSBTE) M6-2 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)
Note