11. What is used to find and fix bugs in Java programs.
Answer : A Explanation: JDB is the correct answer. The Java Debugger (JDB or jdb) is a command-line java debugger that debugs the java class. It is a part of the Java Platform Debugger Architecture (JPDA) that helps in the inspections and debugging of a local or remote Java Virtual Machine (JVM).
12. What is a Primitive Data Type in Java?
- Data Type which is implemented in a machine-dependent way
- Data type, which is implemented in an Object-oriented way
- Data Type which is implemented in a non-object oriented way
- None of the above
Answer : C Explanation: Data Type which is implemented in a non-object oriented way is known as primitive data type.
13. Is it necessary that each try block must be followed by a catch block?
Answer : B Explanation: It is not necessary that each try block must be followed by a catch block. It should be followed by either a catch block or a finally block.
14. Java was publicly released on which date?
Answer : D Explanation: 27-05-1995
15. LinkedHashSet implements:
- All of the above
Answer : D Explanation: None
16. Size of float and double in java is
- 32 and 64
- 64 and 64
- 32 and 32
- 64 and 32
Answer : A Explanation: Size of float and double in java is 32 bit and 64 bit respectively.
17. Size of int in java is
- 32 bit
- 16 bit
- 64 bit
- None of the above
Answer : A Explanation: Size of int in java is 32 bit.
18. Which variables are created when an object is created with the use of the keyword ‘new’ and destroyed when the object is destroyed?
- Local variables
- Class Variables
- Instance variables
- Static variables
Answer : C Explanation: Instance variables are created when an object is created with the use of the keyword ‘new’ and destroyed when the object is destroyed.
19. Which is the valid declarations within an interface definition?
- public double methoda();
- public final double methoda();
- static void methoda(double d1);
- protected void methoda(double d1);
Answer : A Explanation: A public access modifier is acceptable. The method prototypes in an interface are all abstract by virtue of their declaration, and should not be declared abstract. Option A is correct.
20. What allows the programmer to destroy an object x?
- Only the garbage collection system can destroy an object
Answer : D Explanation: When an object is no longer referenced, it may be reclaimed by the garbage collector. If an object declares a finalizer, the finalizer is executed before the object is reclaimed to give the object a last chance to clean up resources that would not otherwise be released. When a class is no longer needed, it may be unloaded.
This Post Has 2 Comments
Pingback: Advance Java MCQ Questions and Answers - cozmocard
Pingback: DBMS MCQ (Multiple Choice Questions and Answers) - cozmocard