Java ProgrammingPrograming & IT Mcqs 100+ MCQ & Answer Java programming | page-03 |Computer Engineering MCQ And Answer January 27, 2025 DSN MARATHI 21. What do you mean by chained exceptions in Java? A. Exceptions occurred by the VirtualMachineError B. An exception caused by other exceptions C. Exceptions occur in chains with discarding the debugging information D. None of the above Answer Option : B 22. In which memory a String is stored, when we create a string using new operator? A. Stack B. String memory C. Heap memory D. Random storage space Answer Option : C 23. What is the use of the intern() method? A. It returns the existing string from memory B. It creates a new string in the database C. It modifies the existing string in the database D. It modifies the existing string in the database Answer Option : A 24. Which of the following is a marker interface? A. Runnable interface B. Remote interface C. Readable interface D. Result interface Answer Option : B 25. Which of the following is a reserved keyword in Java? A. object B. strictfp C. main D. system Answer Option : B 26. Which keyword is used for accessing the features of a package? A. package B. import C. extends D. export Answer Option : B 27. In java, jar stands for_____. A. Java Archive Runner B. Java Application Resource C. Java Application Runner D. None of the above Answer Option : D 28. Which of the following is false? A. The rt.jar stands for the runtime jar B. It is an optional jar file C. It contains all the compiled class files D. All the classes available in rt.jar is known to the JVM Answer Option : B 29. What is the use of \w in regex? A. Used for a whitespace character B. Used for a non-whitespace character C. Used for a word character D. Used for a non-word character Answer Option : C 30. Which of the given methods are of Object class? A. notify(), wait( long msecs ), and synchronized() B. wait( long msecs ), interrupt(), and notifyAll() C. notify(), notifyAll(), and wait() D. sleep( long msecs ), wait(), and notify() Answer Option : C
21. What do you mean by chained exceptions in Java? A. Exceptions occurred by the VirtualMachineError B. An exception caused by other exceptions C. Exceptions occur in chains with discarding the debugging information D. None of the above Answer Option : B
22. In which memory a String is stored, when we create a string using new operator? A. Stack B. String memory C. Heap memory D. Random storage space Answer Option : C
23. What is the use of the intern() method? A. It returns the existing string from memory B. It creates a new string in the database C. It modifies the existing string in the database D. It modifies the existing string in the database Answer Option : A
24. Which of the following is a marker interface? A. Runnable interface B. Remote interface C. Readable interface D. Result interface Answer Option : B
25. Which of the following is a reserved keyword in Java? A. object B. strictfp C. main D. system Answer Option : B
26. Which keyword is used for accessing the features of a package? A. package B. import C. extends D. export Answer Option : B
27. In java, jar stands for_____. A. Java Archive Runner B. Java Application Resource C. Java Application Runner D. None of the above Answer Option : D
28. Which of the following is false? A. The rt.jar stands for the runtime jar B. It is an optional jar file C. It contains all the compiled class files D. All the classes available in rt.jar is known to the JVM Answer Option : B
29. What is the use of \w in regex? A. Used for a whitespace character B. Used for a non-whitespace character C. Used for a word character D. Used for a non-word character Answer Option : C
30. Which of the given methods are of Object class? A. notify(), wait( long msecs ), and synchronized() B. wait( long msecs ), interrupt(), and notifyAll() C. notify(), notifyAll(), and wait() D. sleep( long msecs ), wait(), and notify() Answer Option : C