Advance Java - Exam Sutra MCQ Book by Ur Engineering Friend
Advance Java - Exam Sutra MCQ Book by Ur Engineering Friend
Ur Engineering Friend
5th Sem
Preface
All the questions in the book are very important for the upcoming MSBTE summer
2020 exam. All care has been taken to make students comfortable in
understanding the basic concepts of the subject.
The most important part of this kit is, we are not only providing the books but the
exams too at three different levels (basic, intermediate & advanced). The students
only need to study the book and co-operate us till exam.
We wish to express our profound thanks to all those who helped in making this
book realty. Much needed moral support and encouragement is provided on
numerous occasions by our whole family. We wish to thank the entire team of Ur
Engineering Friend who has taken immense pain to get this book in time with this
quality.
Any suggestion for the improvement of the books will be acknowledged and well
appreciated.
Chapter 1: (Abstract Windowing Toolkit)
Question
Question
a. Window
b. Container
c. Panel
d. Frame
Question
a. 7
b. 6
c. 5
d. 8
Question
a. Java.awt
b. Java.graphics
c. Java.awt.graphics
d. None of these
Question
Which is the container that doesn’t contain title bar and menu bars. It can have
other components like button, text field etc?
a. Window
b. Frame
c. Panel
d. Container
Question
Which object can be constructed to show any number of choices in the visible
window?
a. Choice
b. Menu
c. List
d. Checkbox
Question
a. setText()
b. getText()
c. addText()
d. all of these
Question
a. Server side
b. Client side
Question
Which method of the applet class displays the result of applet code on screen?
a. Run() method
b. Paint() method
c. drawstring() method
d. main() method
Question
a. HTML document
b. Word document
c. Gif file
d. Rtf file
Question
Question
a. .applet file
b. .java html
c. .java file
d. .class file
Question
Which of the following is used to interpret and execute Java Applet Classes
Hosted by HTML?
a. Applet Viewer
b. Applet Screen
c. Applet watcher
d. Applet show
Question
a. Graphical
b. User interactive
c. Both a & b
d. None of the above
Question
a. Display()
b. Paint()
c. displayApplet()
d. show()
Question
a. Display()
b. Paint()
c. Show()
d. All of these
Question
Which object can be constructed to show any number of choices in the visible
window?
a. Labels
b. Choice
c. List
d. Checkbox
Question
a. Component
b. Panel
c. Menu component
d. List
Question
a. Draw()
b. Update()
c. Show()
d. Paint()
Question
a. Start()
b. Stop()
c. Init()
d. Destroy()
Question
Which of these classes can be added to any container class, using the add
method defined in the container class?
a. Button
b. checkboxMenuItem
c. menu
d. menubar
Question
a. Dimension()
b. Setsize()
c. Area()
d. Size()
Question
a. Disappear()
b. Delete()
c. Remove()
d. Hide()
Question
a. True
b. False
Question
The title of the frame can be set in AWT using the method.
a. setHeading
b. setTitle
c. Create Title
d. setTitle
Question
which are passive controls that do not support any interaction with the user?
a. Choice
b. List
c. Labels
d. Checkbox
Question
a. 1
b. 2
c. 3
d. 4
Question
a. setText()
b. getText()
c. addText()
d. all of these
Question
Question
Which layout manager places components in one of the five regions : north, south ,
east , west and center?
a. Absolute layout
b. Grid layout
c. Border layout
d. Flow layout
Question
a. Border layout
b. Card layout
c. Grid layout
d. Flow layout
Question
a. Flow layout
b. Border layout
c. Grid layout
d. All of these
Question
a. Card layout
b. Gridbag layout
c. Frame
d. Border layout
Question
a. Checkbox
b. Drop-down
c. Choice
d. None of these
Question
Which class can be used to represent a checkbox with a textual label that can
appear in a menu?
a. Menu bar
b. Menuitem
c. Checkboxmenuitem
d. Menu
Question
Which abstract class is the super class of all menu related classes?
a. MenuComponent
b. MenuBar
c. MenuItem
d. CheckBoxMenuItem
Question
a. Menus
b. Menubar
c. Frame
d. Both a & b
Question
a. True
b. False
Question
A dialog box is referred to as modeless if the user does not have to close it in
order to continue using the application that owns the dialog box.
a. True
b. False
Question
The ______ class displays a dialog window from which the user can select a
file.
a. Dialog
b. Filedialog
c. File
d. None of these
Chapter 2: Swings
Question
Pluggable look and feel and lightweight components are the features supported
by ________
a. Swing
b. AWT
c. Core java
d. None of these
Question
a. Client server
b. Model view controller
c. layered
d. None of these
Question
a. True
b. False
Question
The java foundation classes ( JFC ) is a set of GUI components which simplify
the development of desktop applications.
a. True
b. False
Question
a. A
b. S
c. G
d. J
Question
_____ is one of the features of object oriented programming that allows the
creation of hierarchical classifications.
a. Polymorphism
b. Class
c. Inheritance
d. Object
Question
a. AbstractButton
b. JToggleButton
c. JComponent
d. None of these
Question
a. JComboBox
b. JTextArea
c. JSlider
d. All of the above
Question
a. Component
b. Window
c. Container
d. Object
Question
a. Glsass
b. Content
c. Container
d. All of the above
Question
a. Setimg
b. setIcon
c. serLabelIcon
d. none of this
Question
a. JList
b. JComboBox
c. JLabel
d. All of the above
Question
a. JButton
b. JCheckBox
c. JRadioButton
d. Both b & c
Question
a. Abstractbutton
b. ButtonGroup
c. JButton
d. ImageIcon
Question
Which method of the component class is used to set the position and size of a
component?
a. setPosition
b. setBounds
c. setSize
d. none of these
Question
1. canvas is a component
2. scrollpane is a container
Question
Question
Question
a. Window
b. Frame
c. Dialog
d. All of the above
Question
a. Button
b. Textfield
c. Label
d. List
Question
a. Flowlayout
b. Gridlayout
c. Border layout
d. Gridbag layout
Question
Question
a. True
b. False
Question
a. Model
b. View
c. Controller
d. None of these
Question
a. Model
b. View
c. Controller
d. None of these
Question
_____ represents enterprise data and the business rules that gives access to
enterprise data.
a. Model
b. View
c. Controller
d. None of these
Chapter 3: Event Handling
Question
a. Java.lang
b. Java.awt
c. Java.awt.event
d. Java.event
Question
a. Same class
b. Other class
c. Anonymous class
d. All of these
Question
a. EventObject
b. Eventclass
c. ActionEvent
d. ItemEvent
Question
Which package provides many event classes and Listener interfaces for event
handling?
a. Java.awt
b. Java.awt.graphics
c. Java.awt.event
d. None of the above
Question
Which of these interfaces handles the event when a component is added to the
container?
a. componentListener
b. ContainerListener
c. FocusListener
d. InputListener
Question
Which of these interfaces define a method actionPerformed() ?
a. Componentlistener
b. Containerlistener
c. Actionlistener
d. Inputlistener
Question
a) Componentlistener
b) Containerlistener
c) Actionlistener
d) Inputlistener
Question
a. Actionevent
b. Componentevent
c. adjustmentEvent
d. WindowEvent
Question
Question
Which of these methods can be used to obtain the command name for invoking
ActionEvent object ?
a. getCommand()
b. getActionCommand()
c. getActionEvent()
d. getActionEventCommand()
Question
a. ComponentListener
b. ContainerListener
c. ActionListener
d. ItemListener
Question
Question
a. WINDOW_ACTIVATED
b. WINDOW_CLOSED
c. WINDOW_DEICONIFIED
d. ALL OF THESE
Question
a) ActionEvent
b) KeyEvent
c) WindowEvent
d) AdjustmentEvent
Question
Which of these constant value will change when the button at the end of scrollbar
was clicked to increase its value?
a. BLOCK_DECREMENT
b. BLOCK_INCREMENT
c. UNIT_DECREMENT
d. UNIT_INCREMENT
Question
a. mouseDragged()
b. mousePressed()
c. mouseReleased()
d. mouseClicked()
Question
a. getPoint()
b. getCoordinates()
c. getMouseXY()
d. getMouseCoordinates()
Question
a. Applet
b. ComponentEvent
c. Event
d. InputEvent
Question
a. getPoint()
b. getCoordinates()
c. getMouseXY()
d. getMouseCoordinates()
Question
a. ComponentEvent
b. ContainerEvent
c. ItemEvent
d. InputEvent
Question
a. TEXT_CHANGED
b. TEXT_FORMAT_CHANGED
c. TEXT_VALUE_CHANGED
d. TEXT_SIZE_CHANGED
Question
a. getMethod()
b. getWindow()
c. getWindowEvent()
d. getWindowObject()
Question
a. getX()
b. getXCoordinate()
c. getCoordinateX()
d. getPointX()
Question
a. WindowEvent
b. ComponentEvent
c. ItemEvent
d. InputEvent
Question
a. KEY_PRESSED
b. KEY_TYPED
c. KEY_RELEASED
d. None of these
Question
What method is used to distinguish between single, double and triple mouse
clicks?
a. getButton()
b. getPoint()
c. getClickCount()
d. getX()
Question
a. TextEvent Class
b. MouseEvent Class
c. WIndowEvent Class
d. KeyEvent Class
Question
a. ActionEvent
b. TextEvent
c. AdjustmentEvent
d. ContainerEvent
Question
a. Java.util.EventListener
b. Java.util.EventObject
c. Java.awt.AWTEvent
d. Java.awt.event.AWTEvent
Question
When two or more objects are added as listeners for the same event, which
listener is first invoked to handle the event?
Question
Which package contains the classes and interfaces required for Java
networking?
a. Java.io
b. Java.util
c. Java.net
d. Java.awt
Question
Question
Which class is used to create servers that listen for either local client or remote
client programs?
a. Serversockets
b. Httpserver
c. Httpresponse
d. None of the above
Question
Question
a. TCP/IP
b. DNS
c. Socket
d. Proxy Server
Question
a. 10
b. 1024
c. 2048
d. 512
Question
a. 8
b. 16
c. 32
d. 64
Question
URL stands for Uniform Resource Locator and represents on the world wide
web, such as a Webpage.
a. True
b. False
Question
a. DatagramPacket
b. URL
c. InetAddress
d. ContentHandler
Question
a. True
b. False
Question
Question
a. IP address of server
b. Port Number
c. Both a and b
d. None of these
Question
a. True
b. False
Question
a. FTP
b. HTTP
c. SMTP
d. Telnet
Question
a. UnknownHostException
b. NullHostException
c. LostHostException
d. IOException
Question
a. URLConnection
b. URL
c. URI
d. None of these
Question
Question
Which method of URL class represents a URL and it has complete set of methods
to manipulate URL in java?
a. Java.net.URL
b. Java.net.URLConnection
c. Java.net.URI
d. None of the above
Chapter 5: Interacting with Database
Question
Question
Question
Which package contains the JDBC classes?
Question
JDBC technology based drivers generally fit into how many categories?
a. 4
b. 3
c. 2
d. 5
Question
Which type of driver provides JDBC access via one or more ODBC drivers?
a. Type 1 driver
b. Type 2 driver
c. Type 3 driver
d. Type 4 driver
Question
Which type of driver converts JDBC calls into the network protocol used by
the database management system directly?
a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver
Question
a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver
Question
a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver
Question
Which driver is efficient and always preferable for using JDBC applications?
a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver
Question
a. Three-tired
b. Multithreaded
c. Best for any platform
d. All of the above
Question
a) Type 1 driver
b) Type 2 driver
c) Type 3 driver
d) Type 4 driver
Question
a. Type 1 and 2
b. Type 1 and 3
c. Type 3 and 4
d. Type 4 only
Question
Question
Question
a. Methods on the result set class for retrieving SQL Select results as
Java types
b. Methods on the prepared statement class for sending java types as
SQL statement parameters.
c. Methods on the callable statement class for retrieving SQL OUT
parameters as java types
d. All of these
Question
The JDBC API has always supported persistent storage of objects defined in
the java programming language through the methods getObject and
setObject.
a. True
b. False
Question
Question
Which of the following describes the correct sequence of the steps involved
in making a connection with a database?
Question
Which of the following methods are needed for loading a database driver in
JDBC?
a. registerDriver() method
b. Class.forName()
c. Both a & b
d. getConnection()
Question
a. preparedStatement
b. parametrizedStatement
c. CallableStatement
d. All of these
Question
a. Statement Interface
b. PreparedStatement Interface
c. ResultSet Interface
d. None of the above
Question
a. DriverManager
b. JDBC driver
c. Connection
d. Statement
Question
a. Statement
b. PrepareStatement
c. CallableStatement
d. CalledStatement
Question
Question
a. True
b. False
Question
All raw data types should be read and uploaded to the database as an array of
_____
a. Byte
b. Int
c. Boolean
d. Char
Question
Are prepared statements actually compiled?
a. Yes
b. No
Question
Question
a. Executed
b. Initialized
c. Prepared
d. Invoked
Question
_______ is an open source DBMS product that runs in window as well as Linux.
a. JSP/SQL
b. MySQL
c. Microsoft Access
d. SQL Server
Question
a. executeUpdate method
b. executeRel method
c. executestmt method
d. executeConn method
Question
method on resultset that tests whether or not there remains at least one
unfetched tuple in result set, is said to be
a. fetch method
b. current method
c. next method
d. access method
Question
the ResultSet.next method is used to move to the next row of the ResultSet,
making it the current row.
a. True
b. False
Question
a. True
b. False
Question
Question
JDBC is a java API that is used to connect and execute query to the database.
a. True
b. False
Chapter 6: servlets
Question
a. Servlet
b. Randomize
c. Applet
d. Script
Question
Which method is used to specify before any lines that uses the PintWriter?
a. setPageType()
b. setContextType()
c. setContentType()
d. setResponseType()
Question
a. Lifecycle management
b. Communication support
c. Multithreading support
d. All of the above
Question
What is bytecode?
a. Machine-specific code
b. Java code
c. Machine-independent code
d. None of these
Question
a. Generic Servlets
b. HttpServlets
c. All of the above
d. None of these
Question
a. True
b. False
Question
a. Javax.servlet
b. Javax.servlet.http
c. Both a & b
d. None of these
Question
Question
Question
Question
Which object is created by the web container at time of deploying the project?
a. servletConfig
b. servletContext
c. both a & b
d. none of these
Question
In HTTP request method Get request is secured because data is exposed in URL
bar
a. True
b. False
Question
a. GenericServlet
b. HTTPServlet
c. Both a & b
d. None of these
Question
a. True
b. False
Question
The doGet() method extracts values of the parameter’s types number by using
_______
a. Response.getAttribute()
b. Response.getParameter()
c. Request.getParameter()
d. Request.setParameter()
Question
a. Servlet filter
b. Servlet config
c. Servlet container
d. Servlet context
Question
Question
a. sendRedirect
b. forward
c. both
d. none
Question
a. doGet
b. doOption
c. doTrace
d. doPost
Question
a. Generic servlets
b. Httpservlets
c. All of these
d. None of these
Question
Question
Which methods are used to bind the objects on HttpSession instance and get the
objects?
a. setAttribute
b. getAttribute
c. both a & b
d. none of these
Question
sessions is a part of the session tracking and it is for maintaining the client state
at server side.
a. True
b. False
Question
Which cookies it is valid for single session only and it is removed each time
when the user closes the browser?
a. Persistent cookies
b. Non-persistent cookies
c. All of these
None of these
Question
a. HttpSession
b. URL rewriting
c. Cookies
d. Hidden form fields
This is not the End, but the Beginning
Thank You