JNDI/JNDI MCQ QUESTIONS AND ANSWER Sample Test,Sample questions

Question:
		
A message driven bean is like a stateful session bean that encapsulates the business logic and doesn't maintain state.

1.True

2.False

3.none

4.all

Posted Date:-2024-01-04 15:47:17


Question:
	
GET methods are great for sending ....................amounts of information that you do not mind having visible in a URL.

1.negligible

2.huge

3.small

4.both and b

Posted Date:-2024-01-04 16:08:14


Question:
	
Implement the Listener interface and overrides its methods. Register the component with the Listener The Following steps are required to perform

1.Exception Handling

2.String Handling

3. Event Handling

4.None of the above

Posted Date:-2024-01-04 15:24:10


Question:
	
JFramemyFrame = new JFrame (); Any command (such as the one listed above) which creates a new object of a specific class (in this case a new JFrame object called myFrame) is generally called a ...

1.Constructor

2.Layout manager

3.Parameter

4.GUI

Posted Date:-2024-01-04 15:27:45


Question:
	
MVC Architecture stands for

1. Model View Controller

2.. Mode View Control

3.. Maximum View Control

4.. None

Posted Date:-2024-01-04 15:29:06


Question:
	
The ActionListener interface is used for handling action events,Forexample,it's used by a

1. JButton

2. JCheckbox

3.JMenuItem

4.All of these

Posted Date:-2024-01-04 15:26:39


Question:
 What does the == operator compare in Java objects?

1.Values

2.References

3.Hash codes

4. Fields

Posted Date:-2024-01-04 16:49:31


Question:
 What is the purpose of the "final" keyword in Java?

1.To prevent the inheritance of a class

2.To prevent overriding of a method

3.To prevent modification of a variable's value

4.All of the above

Posted Date:-2024-01-04 17:46:43


Question:
 What is the purpose of the "final" keyword in Java?

1.To prevent the inheritance of a class

2.To prevent overriding of a method

3.To prevent modification of a variable's value

4.All of the above

Posted Date:-2024-01-04 17:46:43


Question:
 Which loop construct is best suited for iterating over an array or a collection?

1.for loop

2. while loop

3.do-while loop

4.continue statement

Posted Date:-2024-01-04 17:14:03


Question:
 Which of the following is a unary operator?

1.+

2.-

3.!

4.All of the above

Posted Date:-2024-01-04 16:57:24


Question:
. Component used for displaying data in tabular

1.JList

2.JTextArea

3.JTable

4.JTree

Posted Date:-2024-01-04 15:32:04


Question:
..................... is the first phase of the servlet life cycle.

1.Initialization

2.Service

3.Destruction

4.Both a and b

Posted Date:-2024-01-04 16:05:28


Question:
A servlet maintain session in

1.Servlet container

2.Servlet context

3.Servlet request heap

4.Servlet response heap

Posted Date:-2024-01-04 16:23:31


Question:
A servlet needs to acquire a data source through a JNDI naming lookup. Which of the following is the best place to do this?

1.Constructor

2.init method

3.service method

4.doGet method

Posted Date:-2024-01-04 16:10:48


Question:
A session bean represents a multiple clients inside the Application Server.

1.True

2.False

3.none

4.all

Posted Date:-2024-01-04 15:52:10


Question:
Can an interface extend another interface in Java?

1.No

2.Yes

Posted Date:-2024-01-04 18:30:12


Question:
Can an interface have a constructor?

1.Yes

2.No

Posted Date:-2024-01-04 18:30:39


Question:
EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.

1. True

2. False

3.none

4.all

Posted Date:-2024-01-04 15:50:22


Question:
EJB technology is built on the top of Socket Programming

1. True

2. False

3.none

4.all

Posted Date:-2024-01-04 16:01:47


Question:
How can you check if two arrays are equal in Java?

1.Use the == operator

2.Use the .equals() method

3.Use Arrays.equals() method

4.Compare each element one by one

Posted Date:-2024-01-04 17:20:17


Question:
How do you access the fourth element of an array named numbers?

1.numbers[4];

2.numbers(3);

3.numbers[3];

4.numbers.get(3);

Posted Date:-2024-01-04 17:21:20


Question:
How do you declare an array in Java?

1. int arrayName;

2. int[] arrayName;

3.int arrayName[];

4.Both b and c

Posted Date:-2024-01-04 17:15:05


Question:
How do you find the length of a string named 'example'?

1.example.size()

2. example.length()

3.example.getLength()

4.example.len()

Posted Date:-2024-01-04 17:26:43


Question:
How do you initialize an array in Java?

1.int[] arr = (1,2,3,4,5);

2.int arr = {1,2,3,4,5};

3.int[] arr = new int[]{1,2,3,4,5};

4.int arr = new int(5);

Posted Date:-2024-01-04 17:16:59


Question:
How do you initialize an array in Java?

1.int[] arr = (1,2,3,4,5);

2.int arr = {1,2,3,4,5};

3.int[] arr = new int[]{1,2,3,4,5};

4.int arr = new int(5);

Posted Date:-2024-01-04 17:16:59


Question:
How many bits does the long data type use?

1.8

2. 16

3.32

4.64

Posted Date:-2024-01-04 17:06:38


Question:
How many ServletContext objects are available for an entire web application?

1.One each per servlet

2.One each per request

3.One each per response

4.Only one

Posted Date:-2024-01-04 16:27:18


Question:
In EJB, middleware services are provided by EJB Container automatically.

1.True

2.False

3.none

4.all

Posted Date:-2024-01-04 15:58:37


Question:
In Java, strings are:

1.Primitive data types

2.Immutable objects

3.Mutable objects

4.Arrays of characters

Posted Date:-2024-01-04 17:26:08


Question:
In Java, strings are:

1.Primitive data types

2.Immutable objects

3.Mutable objects

4.Arrays of characters

Posted Date:-2024-01-04 17:26:08


Question:
In which year was the first version of Java released?

1.1991

2.1995

3.1998

4.2000

Posted Date:-2024-01-04 16:39:01


Question:
It is lightweight.It supports pluggable look and feel.It follows MVC (Model View Controller) architecture. The following specifies the advantages of

1.Swing

2.AWT

3.Both A & B

4.None of the above

Posted Date:-2024-01-04 15:20:42


Question:
Java Bean is a _____________ technology

1.Component

2.scripting

3.middle tier

4.None

Posted Date:-2024-01-04 15:33:10


Question:
Java Beans are extremely secured?

1.True

2. False

3.none

4.all

Posted Date:-2024-01-04 15:42:43


Question:
Java Servletsare efficient and powerful solution for creating .......for the web.

1.dynamic content

2.static content

3.hardware

4.both and b

Posted Date:-2024-01-04 16:04:39


Question:
JMS is also known as a messaging service.

1.True

2.False

3.none

4.all

Posted Date:-2024-01-04 15:54:03


Question:
JMS is mainly used to send and receive message from one application to another.

1. True

2.False

3.none

4.all

Posted Date:-2024-01-04 15:48:40


Question:
Manifest file is a special file that contains information about the files packed in

1.JAR file

2.GIF

3.JPEG

4.all the above

Posted Date:-2024-01-04 15:34:22


Question:
Servlet mapping defines

1.an association between a URL pattern and a servlet

2.an association between a URL pattern and a request page

3.an association between a URL pattern and a response page

4.All of the above

Posted Date:-2024-01-04 16:24:23


Question:
Several vendors are adding ...................... to their existing database .................

1.JDOBC, middle-ware products

2.JDBC drivers, upper-ware products

3.middle-ware products, JDOBC drivers

4.JDBC drivers, middle-ware products

Posted Date:-2024-01-04 16:09:30


Question:
Swing is not a part of JFC (Java Foundation Classes) that is used to create GUI application?

1.True

2.False

3.none

4.all

Posted Date:-2024-01-04 15:21:45


Question:
The ActionListener interface is not used for handling action events?

1. True

2. False

3.none

4.all

Posted Date:-2024-01-04 15:25:15


Question:
The getSession() method with „true? as its parameter [ getSession(true) ] it will return the appropriate session object when

1.the session is completed

2.the session object is passed to another method

3.the session does not exists

4.the session is existing

Posted Date:-2024-01-04 16:22:41


Question:
The init parameter name and value pairs that are defined in web.xml file are handled by

1.ServletConfig object

2.ServletContext object

3.ServletRequest object

4.ServletResponse object

Posted Date:-2024-01-04 16:26:07


Question:
The service phase of the servlet life cycle represents all interactions with requests until the servlet is ......................

1.created

2.running

3.initiated

4.destroyed

Posted Date:-2024-01-04 16:07:04


Question:
What does JDK include?

1.Only a compiler

2.Only a runtime environment

3.Both a compiler and a runtime environment

4.None of the above

Posted Date:-2024-01-04 16:43:55


Question:
What happens when you try to access an array element with an index that is out of bounds?

1.It returns -1

2.It returns a null value

3.It throws an exception

4.It initializes a new array

Posted Date:-2024-01-04 17:18:33


Question:
What is an infinite loop?

1.A loop that executes only once

2.A loop that never terminates naturally

3.A loop that contains an unreachable code block

4.A loop that uses the continue statement

Posted Date:-2024-01-04 17:12:22


Question:
What is an interface in Java?

1.A class

2.A data type

3.A blueprint for a class

4.A data structure

Posted Date:-2024-01-04 17:47:31


Question:
What is encapsulation in Java?

1.The process of combining data and methods into a single unit

2.The process of hiding data and methods within a class

3.The process of creating multiple instances of a class

4.The process of reusing code from existing classes

Posted Date:-2024-01-04 17:36:32


Question:
What is inheritance in Java?

1.The process of creating multiple instances of a class

2.The process of hiding data and methods within a class

3.The process of reusing code from existing classes

4.The process of combining data and methods into a single unit

Posted Date:-2024-01-04 17:37:23


Question:
What is polymorphism in Java?

1.The ability of a class to inherit properties and behaviors from another class

2.The process of hiding data and methods within a class

3.The process of creating multiple instances of a class

4.The ability of an object to take on many forms

Posted Date:-2024-01-04 17:38:18


Question:
What is polymorphism?

1.Multiple forms

2. Single form

3.No form

4.Static form

Posted Date:-2024-01-04 17:31:33


Question:
What is the default value of the int data type?

1.0

2.1

3.null

4.Undefined

Posted Date:-2024-01-04 17:04:21


Question:
What is the key difference between a while loop and a do-while loop in Java?

1.The syntax used to define the loop

2.The number of iterations performed

3.The condition check timing

4.The ability to use the break statement

Posted Date:-2024-01-04 17:10:44


Question:
What is the output of the expression true || false?

1.true

2.false

3.null

4. 0

Posted Date:-2024-01-04 17:00:50


Question:
What is the primary function of JRE?

1.Compilation

2.Debugging

3.Execution

4.Development

Posted Date:-2024-01-04 16:47:36


Question:
What is the purpose of the "super" keyword in Java?

1.To refer to the current object

2.To invoke the superclass constructor or methods

3.To create multiple instances of a class

4.To hide data and methods within a class

Posted Date:-2024-01-04 17:44:52


Question:
What is the purpose of the "this" keyword in Java?

1.To refer to the superclass

2.To create multiple instances of a class

3.To hide data and methods within a class

4.To refer to the current object

Posted Date:-2024-01-04 17:45:51


Question:
What is the purpose of the continue statement in a loop?

1.To exit the loop immediately

2.To skip the current iteration and move to the next iteration

3.To terminate the program

4.To execute a specific block of code

Posted Date:-2024-01-04 17:09:19


Question:
What is the result of the expression "Java" + "Programming"?

1.JavaProgramming

2. Java Programming

3. Java Programming

4.JavaProgramming-

Posted Date:-2024-01-04 17:27:31


Question:
What is the result of the expression "Java" + "Programming"?

1.JavaProgramming

2. Java Programming

3. Java Programming

4.JavaProgramming-

Posted Date:-2024-01-04 17:27:31


Question:
What is the root class for all Java classes?

1.Object

2.Class

3.Superclass

4. Root

Posted Date:-2024-01-04 17:30:42


Question:
What was the original name for Java?

1. C++++

2.Oak

3.Pine

4.Maple

Posted Date:-2024-01-04 16:41:58


Question:
What's the difference between servlets and applets? a. Servlets executes on Servers, where as

1.Applets executes on Browser

2.Servlets have no GUI, where as an Applet has GUI

3.Servlets creates static web pages, where as Applets creates dynamic web pages

4.Servlets can handle only a single request, where as Applet can handle multiple requests

Posted Date:-2024-01-04 16:11:30


Question:
What's the main difference between int and Integer in Java?

1.No difference

2.Integer can store larger values than int

3.int is a primitive data type, while Integer is a class

4.int can be null, while Integer cannot

Posted Date:-2024-01-04 17:07:39


Question:
Which class can create a string that is thread-safe?

1.String

2.StringBuffer

3.StringBuilder

4.StringBuilder

Posted Date:-2024-01-04 17:29:59


Question:
Which class provides many methods for graphics programming?

1. java.awt

2. java.Graphics

3. java.awt.Graphics

4. None of the above

Posted Date:-2024-01-04 15:23:16


Question:
Which data type can store a single character?

1.String

2. byte

3.char

4.int

Posted Date:-2024-01-04 17:05:50


Question:
Which is the container that doesn't contain title bar and MenuBars but it can have other components like button, textfieldetc?

1.Window

2.Frame

3.Panel

4.all the above

Posted Date:-2024-01-04 15:30:00


Question:
Which is the passive control that do not support any interaction with the user?

1.JList

2.JLabel

3.JTable

4.JTree

Posted Date:-2024-01-04 15:31:01


Question:
Which keyword is used to implement an interface?

1.extends

2. new

3.interface

4.implements

Posted Date:-2024-01-04 18:29:34


Question:
Which loop construct guarantees that the loop body is executed at least once?

1.for loop

2.while loop

3.do-while loop

4.continue statement

Posted Date:-2024-01-04 17:11:36


Question:
Which loop construct in Java is best suited when the number of iterations is known?

1.for loop

2.while loop

3.do-while loop

4.break statement

Posted Date:-2024-01-04 17:08:29


Question:
Which loop construct in Java is best suited when the number of iterations is unknown?

1. for loop

2.while loop

3.do-while loop

4. none

Posted Date:-2024-01-04 17:09:56


Question:
Which method is used to compare two strings for equality?

1. ==

2. equals()

3.compare()

4. isEqual()

Posted Date:-2024-01-04 17:28:23


Question:
Which method is used to get the length of an array in Java?

1.length()

2. size()

3.getLength()

4.length

Posted Date:-2024-01-04 17:16:07


Question:
Which method is used to specify before any lines that uses the PrintWriter?

1.setPageType()

2.setContextType()

3.setContentType()

4.setResponseType()

Posted Date:-2024-01-04 16:17:00


Question:
Which of the following access modifiers are implicitly applied to variables in an interface?

1.private

2.protected

3.public

4.default

Posted Date:-2024-01-04 18:31:23


Question:
Which of the following are the session tracking techniques?

1.URL rewriting, using session object, using response object, using hidden fields

2.URL rewriting, using session object, using cookies, using hidden fields

3.URL rewriting, using servlet object, using response object, using cookies

4.URL rewriting, using request object, using response object, using session object

Posted Date:-2024-01-04 16:21:27


Question:
Which of the following creates a mutable string?

1.String

2.StringBuilder

3.StringChar

4.StringMutable

Posted Date:-2024-01-04 17:25:13


Question:
Which of the following data types can store a floating-point number?

1.int

2.byte

3.double

4.char

Posted Date:-2024-01-04 17:05:07


Question:
Which of the following is NOT a part of the JRE?

1.Bytecode verifier

2.Classloader

3.Java Compiler

4. Java API classes

Posted Date:-2024-01-04 16:46:03


Question:
Which of the following is not a primitive data type in Java?

1.byte

2.String

3.double

4.short

Posted Date:-2024-01-04 17:03:27


Question:
Which of the following is not true about Java beans?

1.Implements java.io.Serializable interface

2.Extends java.io.Serializable class

3.Provides no argument constructor

4.Provides setter and getter methods for its properties

Posted Date:-2024-01-04 15:37:17


Question:
Which of the following is responsible for converting bytecode into machine code?

1.JDK

2. JRE

3.JVM

4.Java Compiler

Posted Date:-2024-01-04 16:42:59


Question:
Which of the following operators is used for concatenation of two strings?

1.+

2.*

3.&

4.+=

Posted Date:-2024-01-04 17:22:11


Question:
Which of the following package contains servlet classes?

1.javax.servlet

2.javax.servlet.http

3.Both of the above

4.None of the above

Posted Date:-2024-01-04 16:28:11


Question:
Which operator has the highest precedence?

1.+

2.*

3.()

4.&&

Posted Date:-2024-01-04 16:58:51


Question:
Which operator is used for logical "AND" operation?

1.&&

2.&

3.||

4.|

Posted Date:-2024-01-04 16:52:23


Question:
Which operator is used to perform bitwise "AND" operation?

1.&&

2.&

3.|

4.||

Posted Date:-2024-01-04 16:55:31


Question:
Which statement is used to exit a loop prematurely?

1.return statement

2.continue statement

3.break statement

4.exit statement

Posted Date:-2024-01-04 17:13:14


Question:
Who developed the Java programming language?

1.Microsoft

2.Oracle

3.Sun Microsystems

4.Google

Posted Date:-2024-01-04 16:37:18


More MCQS

  1. JNDI MCQ QUESTIONS AND ANSWER
  2. JNDI MCQ QUESTIONS AND ANSWER
  3. JNDI MCQ QUESTIONS AND ANSWER
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!