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
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
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
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
MVC Architecture stands for
1. Model View Controller
2.. Mode View Control
3.. Maximum View Control
4.. None
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
What does the == operator compare in Java objects?
1.Values
2.References
3.Hash codes
4. Fields
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
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
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
Which of the following is a unary operator?
1.+
2.-
3.!
4.All of the above
. Component used for displaying data in tabular
1.JList
2.JTextArea
3.JTable
4.JTree
..................... is the first phase of the servlet life cycle.
1.Initialization
2.Service
3.Destruction
4.Both a and b
A servlet maintain session in
1.Servlet container
2.Servlet context
3.Servlet request heap
4.Servlet response heap
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
A session bean represents a multiple clients inside the Application Server.
1.True
2.False
3.none
4.all
Can an interface extend another interface in Java?
1.No
2.Yes
Can an interface have a constructor?
1.Yes
2.No
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
EJB technology is built on the top of Socket Programming
1. True
2. False
3.none
4.all
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
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);
How do you declare an array in Java?
1. int arrayName;
2. int[] arrayName;
3.int arrayName[];
4.Both b and c
How do you find the length of a string named 'example'?
1.example.size()
2. example.length()
3.example.getLength()
4.example.len()
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);
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);
How many bits does the long data type use?
1.8
2. 16
3.32
4.64
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
In EJB, middleware services are provided by EJB Container automatically.
1.True
2.False
3.none
4.all
In Java, strings are:
1.Primitive data types
2.Immutable objects
3.Mutable objects
4.Arrays of characters
In Java, strings are:
1.Primitive data types
2.Immutable objects
3.Mutable objects
4.Arrays of characters
In which year was the first version of Java released?
1.1991
2.1995
3.1998
4.2000
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
Java Bean is a _____________ technology
1.Component
2.scripting
3.middle tier
4.None
Java Beans are extremely secured?
1.True
2. False
3.none
4.all
Java Servletsare efficient and powerful solution for creating .......for the web.
1.dynamic content
2.static content
3.hardware
4.both and b
JMS is also known as a messaging service.
1.True
2.False
3.none
4.all
JMS is mainly used to send and receive message from one application to another.
1. True
2.False
3.none
4.all
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
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
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
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
The ActionListener interface is not used for handling action events?
1. True
2. False
3.none
4.all
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
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
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
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
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
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
What is an interface in Java?
1.A class
2.A data type
3.A blueprint for a class
4.A data structure
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
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
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
What is polymorphism?
1.Multiple forms
2. Single form
3.No form
4.Static form
What is the default value of the int data type?
1.0
2.1
3.null
4.Undefined
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
What is the output of the expression true || false?
1.true
2.false
3.null
4. 0
What is the primary function of JRE?
1.Compilation
2.Debugging
3.Execution
4.Development
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
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
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
What is the result of the expression "Java" + "Programming"?
1.JavaProgramming
2. Java Programming
3. Java Programming
4.JavaProgramming-
What is the result of the expression "Java" + "Programming"?
1.JavaProgramming
2. Java Programming
3. Java Programming
4.JavaProgramming-
What is the root class for all Java classes?
1.Object
2.Class
3.Superclass
4. Root
What was the original name for Java?
1. C++++
2.Oak
3.Pine
4.Maple
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
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
Which class can create a string that is thread-safe?
1.String
2.StringBuffer
3.StringBuilder
4.StringBuilder
Which class provides many methods for graphics programming?
1. java.awt
2. java.Graphics
3. java.awt.Graphics
4. None of the above
Which data type can store a single character?
1.String
2. byte
3.char
4.int
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
Which is the passive control that do not support any interaction with the user?
1.JList
2.JLabel
3.JTable
4.JTree
Which keyword is used to implement an interface?
1.extends
2. new
3.interface
4.implements
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
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
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
Which method is used to compare two strings for equality?
1. ==
2. equals()
3.compare()
4. isEqual()
Which method is used to get the length of an array in Java?
1.length()
2. size()
3.getLength()
4.length
Which method is used to specify before any lines that uses the PrintWriter?
1.setPageType()
2.setContextType()
3.setContentType()
4.setResponseType()
Which of the following access modifiers are implicitly applied to variables in an interface?
1.private
2.protected
3.public
4.default
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
Which of the following creates a mutable string?
1.String
2.StringBuilder
3.StringChar
4.StringMutable
Which of the following data types can store a floating-point number?
1.int
2.byte
3.double
4.char
Which of the following is NOT a part of the JRE?
1.Bytecode verifier
2.Classloader
3.Java Compiler
4. Java API classes
Which of the following is not a primitive data type in Java?
1.byte
2.String
3.double
4.short
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
Which of the following is responsible for converting bytecode into machine code?
1.JDK
2. JRE
3.JVM
4.Java Compiler
Which of the following operators is used for concatenation of two strings?
1.+
2.*
3.&
4.+=
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
Which operator has the highest precedence?
1.+
2.*
3.()
4.&&
Which operator is used for logical "AND" operation?
1.&&
2.&
3.||
4.|
Which operator is used to perform bitwise "AND" operation?
1.&&
2.&
3.|
4.||
Which statement is used to exit a loop prematurely?
1.return statement
2.continue statement
3.break statement
4.exit statement
Who developed the Java programming language?
1.Microsoft
2.Oracle
3.Sun Microsystems
4.Google