Explore topic-wise MCQs in Placement Tests.

This section includes 765 Mcqs, each offering curated multiple-choice questions to sharpen your Placement Tests knowledge and support exam preparation. Choose a topic below to get started.

601.

What type of constructor is used to provide different values to the distinct objects?

A. Default constructor
B. Parameterized constructor
C. Overloading constructor
D. None of the above
Answer» C. Overloading constructor
602.

What package is a part of the wrapper class which is imported by default into all Java programs?

A. java.lang
B. java.awt
C. java.io
D. java.util
Answer» B. java.awt
603.

What method Returns an enumeration of the keys which includes those keys found in the default property list?

A. Enumeration keys()
B. Enumeration elements()
C. Enumeration propertyNames()
D. Both A & B
Answer» D. Both A & B
604.

What is XML used to simplify?

A. Data storage
B. Data sharing
C. Both A & B
D. None of the above
Answer» D. None of the above
605.

What is used to run an Applet?

A. An html file
B. An AppletViewer tool(for testing purpose)
C. Both A & B
D. None of the above
Answer» D. None of the above
606.

What is used to display the intermediate result in an interceptor?

A. Params Interceptor
B. Custom Interceptor
C. ExecAndWait Interceptor
D. Prepare Interceptor
Answer» D. Prepare Interceptor
607.

What is used to convert the byte-oriented stream into character-oriented stream?

A. Console
B. Scanner
C. InputStreamReader
D. DataInputStream
Answer» D. DataInputStream
608.

What is the reason that a java program cannot directly communicate with an ODBC driver?

A. ODBC written in C# language
B. ODBC written in C language
C. ODBC written in C++ languageNone of the above
D. None of the above
Answer» C. ODBC written in C++ languageNone of the above
609.

What is the range of the int data type?

A. –2,147,483,648 to 2,147,483,647
B. -2,147,483,647 to 2,147,483,648
C. -32,768 to 32,767
D. -32,767 to 32,768
Answer» B. -2,147,483,647 to 2,147,483,648
610.

What is the disadvantage of Garbage Collection?

A. It makes java memory efficient because garbage collector removes the unreferenced objects from heap memory
B. It is automatically done by the garbage collector so we don't need to make extra efforts
C. None of the above
D. Both A & B
Answer» D. Both A & B
611.

What is the advantage of Method Overloading?

A. Method overloading increases the readability of the program
B. Method overloading does not increases the readability of the program
C. Method overloading does not increases the reliability of the program
D. None of the above
Answer» B. Method overloading does not increases the readability of the program
612.

What is responsible in MVC for managing the data of the application which responds to the request from the view as well as to the instructions from the controller to update itself?

A. View
B. Model
C. Controller
D. None of the above
Answer» C. Controller
613.

What is meant by JIT?

A. Java In Time
B. Just In Time
C. Join In Time
D. None of the above
Answer» C. Join In Time
614.

What is known as the classes that extend Throwable class except RuntimeException and Error?

A. Checked Exception
B. Unchecked Exception
C. Error
D. None of the above
Answer» B. Unchecked Exception
615.

What invokes immediately after the start() method and also any time the applet needs to repaint itself in the browser?

A. stop()
B. init()
C. paint()
D. destroy()
Answer» D. destroy()
616.

What does the Session object hold?

A. First Level Cache
B. Second Level Cache
C. Both A & B
D. None of the above
Answer» B. Second Level Cache
617.

What defines the method by which you can enumerate (obtain one at a time) the elements in a collection of objects?

A. Stack class
B. Bitset class
C. Enumeration interface
D. None of the above
Answer» D. None of the above
618.

What can be accessed or inherited without actual copy of code to each program?

A. Browser
B. Applet
C. Package
D. None of the above
Answer» D. None of the above
619.

What are the main subclasses of the Exception class?

A. IOException class
B. RuntimeException Class
C. ClassCastException
D. Both A & B
Answer» E.
620.

We need to write the controller code self, If we change the controller code, we need to recompile the class and redeploy the application this is a disadvantage of which MVC Architecture?

A. MVC 1 Architecture
B. MVC 2 Architecture
C. All of the above
D. None of the above
Answer» C. All of the above
621.

We need to specify @Inheritance(strategy=InheritanceType.JOINED) in the parent class and @PrimaryKeyJoinColumn annotation in the subclasses.

A. True
B. False
Answer» B. False
622.

Void is not a wrapper class

A. True
B. False
Answer» B. False
623.

Using mail API we cannot send mail from a servlet.

A. True
B. False
Answer» C.
624.

URL stands for Uniform Resource Locator and represents a resource on the World Wide Web, such as a Web page or FTP directory.

A. True
B. False
Answer» B. False
625.

URL is an acronym for?

A. Uniform Resource Locator
B. Unified Resource Locator
C. Uniform Restore Locator
D. Unified Restore Locator
Answer» B. Unified Resource Locator
626.

Under which package is the string class encapsulated?

A. java.lang
B. java.util
C. java.io
D. java.awt
Answer» B. java.util
627.

Unchecked exceptions are checked at compile-time rather they are checked at runtime.

A. True
B. False
Answer» C.
628.

Thread class constructor allocates a new thread object

A. True
B. False
Answer» B. False
629.

These two ways are used to create a Frame (1) By creating the object of Frame class (association) (2) By extending Frame class (inheritance)

A. True
B. False
Answer» B. False
630.

The wrapper classes are part of the which package, that is imported by default into all Java programs?

A. java.lang
B. java.awt
C. java.io
D. java.util
Answer» B. java.awt
631.

The workflow interceptor is used to get information about the error messages defined in the action class.

A. True
B. False
Answer» B. False
632.

The values configured in struts.properties file will override the default values configured in default.properties which is contained in the struts2-core-x.y.z.jar distribution.

A. True
B. False
Answer» B. False
633.

The URLConnection class can be used to read and write data to the specified resource referred by the URL

A. True
B. False
Answer» B. False
634.

The struts 2 framework is used to develop MVC-based web application

A. True
B. False
Answer» B. False
635.

The sendRedirect() method of HttpServletResponse interface can be used to redirect response to another resource, it may be servlet, jsp or html file.

A. True
B. False
Answer» B. False
636.

The ResultSet.next method is used to move to the next row of the ResultSet, making it the current row.

A. True
B. False
Answer» B. False
637.

The PipedInputStream and PipedOutputStream classes can be used to read and write data simultaneously.

A. True
B. False
Answer» B. False
638.

The performance of the application will be faster if you use PreparedStatement interface because query is compiled only once.

A. True
B. False
Answer» B. False
639.

The object cloning is a way to create exact copy of an object

A. True
B. False
Answer» B. False
640.

The Object class is not a parent class of all the classes in java by default.

A. True
B. False
Answer» C.
641.

The life cycle of the thread is controlled by ?

A. JVM
B. JDK
C. JRE
D. None of the above
Answer» B. JDK
642.

The JDK forms an extended subset of a software development kit (SDK)

A. True
B. False
Answer» B. False
643.

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
Answer» B. False
644.

The Java Virtual Machine is the cornerstone of the Java platform.

A. True
B. False
Answer» B. False
645.

The Java Foundation Classes (JFC) is a set of GUI components which simplify the development of desktop applications.

A. True
B. False
Answer» B. False
646.

The intent is for JDBC drivers to implement nonscrollable result sets using the support provided by the underlying database systems.

A. True
B. False
Answer» C.
647.

The i18n interceptor provides multi-lingual support for your application

A. True
B. False
Answer» B. False
648.

The getElementsByTagName() method is used to retrieve data from an XML document.

A. True
B. False
Answer» B. False
649.

The following two rules are defined by? 1. The parameters may differ in their type or number, or in both. 2. They may have the same or different return types.

A. Method overloading
B. Method overriding
C. Constructor overloading
D. None of the above
Answer» B. Method overriding
650.

The Following steps are required to perform (1) Implement the Listener interface and overrides its methods (2) Register the component with the Listener

A. Exception Handling
B. String Handling
C. Event Handling
D. None of the above
Answer» D. None of the above