Author name: admin

Which of the following is not a feature of Java?

Java MCQ: Which of the following is not a feature of Java? a) Platform-independent b) Object-oriented c) Pointers d) Secure Answer: c) Pointers Explanation: Java is a platform-independent, object-oriented, and secure programming language, but it does not support pointers. Pointers are used in languages like C and C++ to directly access memory addresses, but Java

Which of the following is not a feature of Java? Read More »

Which of the following statements is true about constructors in Java?

Java MCQ: Which of the following statements is true about constructors in Java? a) Constructors can be abstract b) Constructors can be final c) Constructors cannot be synchronized d) Constructors do not return any value Answer: d) Constructors do not return any value Explanation: Constructors in Java are special methods used to initialize objects. They

Which of the following statements is true about constructors in Java? Read More »

Which of the following is used to define a block of code that can handle exceptions in Java?

Java MCQ: Which of the following is used to define a block of code that can handle exceptions in Java? a) try block b) catch block c) finally block d) All of the above Answer: d) All of the above Explanation: In Java, exception handling involves several constructs, including the try, catch, and finally blocks.

Which of the following is used to define a block of code that can handle exceptions in Java? Read More »

Which of the following is a checked exception in Java?

Java MCQ: Which of the following is a checked exception in Java? a) NullPointerException b) IOException c) ArithmeticException d) ArrayIndexOutOfBoundsException Answer: b) IOException Explanation: In Java, exceptions are categorized into two main types: checked exceptions and unchecked exceptions. Checked exceptions are exceptions that must be either caught or declared in the method signature using the

Which of the following is a checked exception in Java? Read More »

Scroll to Top