πŸ§ͺ EJB MCQ Quiz Hub

EJB Core Java Mcq Questions

Choose a topic to test your knowledge and improve your EJB skills

Which services are provided to EJB components by the EJB container?





βœ… Correct Answer: 4

Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?





βœ… Correct Answer: 1

Abbreviate the term JMS?





βœ… Correct Answer: 1

Which session bean maintain their state between client invocations but are not required to maintain their state across server crashes or shutdowns?





βœ… Correct Answer: 3

Which component does the Entity bean represent the persistent data stored in the database?





βœ… Correct Answer: 1

EJB is like COM Abbreviate the term COM?





βœ… Correct Answer: 1

What represents a persistent global data from the database?





βœ… Correct Answer: 1

Which component does the Entity bean represents the persistent data stored in the database?





βœ… Correct Answer: 1

Which middleware services are provided by EJB?





βœ… Correct Answer: 3

Which server-side component is required to be deployed on the server?





βœ… Correct Answer: 1

How many types of session beans are available in EJB?





βœ… Correct Answer: 2

Which type of instances retain no data or conversational state for a specific client?





βœ… Correct Answer: 1

Which session bean does the conversational state between multiple method calls is not maintained by the container?





βœ… Correct Answer: 2

Which method returns the interrupted flag after that it sets the flag to false if it is true?





βœ… Correct Answer: 2

From the following statements which is a disadvantage of an java array?





βœ… Correct Answer: 4

The following Syntax is used for?class Subclass-name extends Superclass-name{//methods and fields}





βœ… Correct Answer: 3

Which constructor creates an empty string buffer with the specified capacity as length.





βœ… Correct Answer: 3

How many reserved keywords are currently defined in the Java language?





βœ… Correct Answer: 2

Which mechanism is used when a thread is paused running in its critical section and another thread is allowed to enter (or lock) in the same critical section to be executed?





βœ… Correct Answer: 1

Which method is used to change the name of a thread?





βœ… Correct Answer: 2

Which class is used to uncompress the file in the deflate compression format It provides facility to the other uncompression filters?





βœ… Correct Answer: 2

Which is used for reading streams of raw bytes such as image data and for reading streams of characters consider using FileReader?





βœ… Correct Answer: 1

Mutual exclusive and inter-thread communication are which type of Synchorization?





βœ… Correct Answer: 1

Which is irrecoverable?





βœ… Correct Answer: 1

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





βœ… Correct Answer: 1

Which methods are provided by the PrintStream class?





βœ… Correct Answer: 2

hich Exception occurs when a class is not found while dynamically loading a class using the class loaders?





βœ… Correct Answer: 1

Which method of string class in java is used to convert the boolean into String?





βœ… Correct Answer: 1

Which is used to separate the hierarchy of the class while declaring an import statement?





βœ… Correct Answer: 1

Which Thread pool is used where container creates a thread pool to process the request?





βœ… Correct Answer: 3

Which field of StreamTokenizer if the token is a word this filed contains the word that can be used in programming?





βœ… Correct Answer: 2

Which statement provides an easy way to dispatch execution to different parts of your code based on the value of an expression?





βœ… Correct Answer: 2

The following program is an example for?class Student{int id;String name;void display(){System.out.println(id+ +name);}public static void main(String args[]){Student s1=new Student();Student s2=new Student();s1.display();s2.display();}}- Published on 20 Jul 15a. b. c. d.





βœ… Correct Answer: 2

If you are inserting any value in the wrong index as shown below1. int a[]=new int[5];2. a[10]=50;it would result in ______.





βœ… Correct Answer: 2

The following program is an example of?class Simple{public static void main(String args[]){String s=Sachin;System.out.println(s.length());//6}}





βœ… Correct Answer: 1

Which provides accessibility to classes and interface?





βœ… Correct Answer: 1

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





βœ… Correct Answer: 3

Which variables are created when an object is created with the use of the keyword new and destroyed when the object is destroyed?





βœ… Correct Answer: 2

Which is a superclass of all exception classes?





βœ… Correct Answer: 1

Which access specifiers can be used for a class so that itοΏ½s members can be accessed by a different class in the different package?





βœ… Correct Answer: 2

Which keyword is used to make the classes and interface of another package accessible to the current package?





βœ… Correct Answer: 1

Which method returns a reference to the currently executing thread object?





βœ… Correct Answer: 1

Which are subclasses of FilterInputStream and FilterOutputStream?





βœ… Correct Answer: 4

What is the range of the int data type?





βœ… Correct Answer: 1

Which is a mechanism where one object acquires all the properties and behaviors of the parent object?





βœ… Correct Answer: 1

Which class is thread-safe i.e. multiple threads cannot access it simultaneouslySo it is safe and will result in an order?





βœ… Correct Answer: 1

Which is a technique in Java in which a class can have any number of constructors that differ in parameter lists?





βœ… Correct Answer: 1

Which class members can be accessed from the classes in the same package as well as classes in other Packages that are subclasses of the declaring class?





βœ… Correct Answer: 3

How many methods does a thread class provides for sleeping a thread?





βœ… Correct Answer: 4

Under which package is the string class encapsulated?





βœ… Correct Answer: 1

How many ways are there to access package from another package?





βœ… Correct Answer: 1

Which state is the thread still alive but is currently not eligible to run?





βœ… Correct Answer: 1

Which method of DataInputStream class reads a line from the file and returns it as a string?





βœ… Correct Answer: 2

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





βœ… Correct Answer: 2

Which class is used when a program does not want to handle an exception?





βœ… Correct Answer: 1

How many types of constructor are defined in the StringTokenizer class?





βœ… Correct Answer: 2

Which package includes all the standard classes of java?





βœ… Correct Answer: 1

What will happen if we call the run() method directly instead of calling the start() method?





βœ… Correct Answer: 3

Which method waits for a thread to die?





βœ… Correct Answer: 4

Which package includes StringTokenizer that tokenizes a string into independent words?





βœ… Correct Answer: 3

JVM stands for?





βœ… Correct Answer: 4

Which keyword is used by classes to implement an interface?





βœ… Correct Answer: 2

A class is declared inside a class but outside a method it is known as ________.





βœ… Correct Answer: 2

Which default exception handler that performs the following tasks:- Prints out exception description.- Prints the stack trace (Hierarchy of methods where the exception occurred).- Causes the program to terminate.





βœ… Correct Answer: 1

Which string function returns the number of characters in a string?





βœ… Correct Answer: 1

Who is also called father of Java Programming Language?





βœ… Correct Answer: 1

Which classes has Sun Microsystem suggested not to use for read and write the textual information?





βœ… Correct Answer: 3

Which provides a new way for your programs to interface with code libraries written in other languages?





βœ… Correct Answer: 1

What is the advantage of Method Overloading?





βœ… Correct Answer: 1

Which symbol is used to contain the values of automatically initialized arrays. Also used to define a block of code for classes methods and local scopes?





βœ… Correct Answer: 2

Which packages are also termed as Java API Packages?





βœ… Correct Answer: 1

Which method is used in thread class to starts the execution of the thread?





βœ… Correct Answer: 1

Which stream does Java application uses to read data from a source it may be a file an array peripheral device or socket?





βœ… Correct Answer: 1

Which type of inheritance one super-class have more than one sub-class?





βœ… Correct Answer: 1

If a subclass has the same method as declared in the parent class it is known as ______.





βœ… Correct Answer: 1

Which method is used to invoke the garbage collector to perform the cleanup processing?





βœ… Correct Answer: 1

What are the main subclasses of the Exception class?





βœ… Correct Answer: 4

Which method causes the current thread to wait for the specified milliseconds until the another thread notifies? (invokes notify() or notifyAll() method)?a. b. c. d.





βœ… Correct Answer: 1

Which package is used for GUI?





βœ… Correct Answer: 2

Which method in thread class causes the currently executing thread object to temporarily pause and allow other threads to execute?





βœ… Correct Answer: 3