🧪 EJB MCQ Quiz Hub

EJB Core Java Mcq Questions

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

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




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




3. Abbreviate the term JMS?




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




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




6. EJB is like COM Abbreviate the term COM?




7. What represents a persistent global data from the database?




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




9. Which middleware services are provided by EJB?




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




11. How many types of session beans are available in EJB?




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




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




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




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




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




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




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




19. 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?




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




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




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




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




24. Which is irrecoverable?




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




26. Which methods are provided by the PrintStream class?




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




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




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




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




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




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




33. 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.




34. 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 ______.




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




36. Which provides accessibility to classes and interface?




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




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




39. Which is a superclass of all exception classes?




40. 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?




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




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




43. Which are subclasses of FilterInputStream and FilterOutputStream?




44. What is the range of the int data type?




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




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




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




48. 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?




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




50. Under which package is the string class encapsulated?




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




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




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




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




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




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




57. Which package includes all the standard classes of java?




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




59. Which method waits for a thread to die?




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




61. JVM stands for?




62. Which keyword is used by classes to implement an interface?




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




64. 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.




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




66. Who is also called father of Java Programming Language?




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




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




69. What is the advantage of Method Overloading?




70. 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?




71. Which packages are also termed as Java API Packages?




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




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




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




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




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




77. What are the main subclasses of the Exception class?




78. 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.




79. Which package is used for GUI?




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