Java Programming

Java is a high-level, object-oriented programming language developed by Sun Microsystems in the mid-1990s. It adheres to the “Write Once, Run Anywhere” (WORA) principle, ensuring platform independence via the Java Virtual Machine (JVM).

Java is a widely used programming language for coding web applications. It has been a popular choice among developers for over two decades, with millions of Java applications in use today. Java is a multi-platform, object-oriented, and network-centric language that can be used as a platform in itself. It is a fast, secure, reliable programming language for coding everything from mobile apps and enterprise software to big data applications and server-side technologies.

Which of the following is NOT a benefit of using Generics in Java?

Java MCQ: Which of the following is NOT a benefit of using Generics in Java? a) Code reusability b) Runtime type checking c) Type safety d) Elimination of type casting Answer: b) Runtime type checking Explanation: Generics in Java offer several benefits, including code reusability, type safety, and the elimination of explicit type casting. However,

Which of the following is NOT a benefit of using Generics in Java? Read More »

Which class provides system-independent server-side implementation?

Java MCQ: Which class provides system-independent server-side implementation? a) Socket b) ServerSocket c) DatagramSocket d) None of the above Answer: b) ServerSocket Explanation: The ServerSocket class in Java provides a system-independent mechanism for server-side socket communication. It listens for requests on a specified port and establishes a connection with clients. Reference links: https://www.rameshfadatare.com/learn-java-programming/ https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Which class provides system-independent server-side implementation? Read More »

Which of these packages contains the exception StackOverflow in Java?

Java MCQ: Which of these packages contains the exception StackOverflow in Java? a) java.lang b) java.util c) java.io d) java.net Answer: a) java.lang Explanation: The StackOverflowError in Java is part of the java.lang package. It is thrown when a stack overflow occurs because an application recurses too deeply. Reference links: https://www.rameshfadatare.com/learn-java-programming/ https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Which of these packages contains the exception StackOverflow in Java? Read More »

Which exception is thrown when Java is out of memory?

Java MCQ: Which exception is thrown when Java is out of memory? a) MemoryError b) OutOfMemoryError c) NullPointerException d) IOException Answer: b) OutOfMemoryError Explanation: When the Java Virtual Machine (JVM) runs out of memory, it throws an OutOfMemoryError. This error indicates that the JVM cannot allocate an object because it is out of memory and

Which exception is thrown when Java is out of memory? Read More »

What is the extension of compiled Java classes?

Java MCQ: What is the extension of compiled Java classes? a) .js b) .class c) .java d) .exe Answer: b) .class Explanation: Compiled Java classes are stored in files with the .class extension. These files contain bytecode, which can be executed by the Java Virtual Machine (JVM). Reference links: https://www.rameshfadatare.com/learn-java-programming/ https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

What is the extension of compiled Java classes? Read More »

Which of the following is not an OOPS concept in Java?

Java MCQ: Which of the following is not an OOPS concept in Java? a) Inheritance b) Encapsulation c) Polymorphism d) Compilation Answer: d) Compilation Explanation: Compilation is not an object-oriented programming (OOP) concept. The main OOP concepts in Java are Inheritance, Encapsulation, Polymorphism, and Abstraction. Reference links: https://www.rameshfadatare.com/learn-java-programming/ https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Which of the following is not an OOPS concept in Java? Read More »

What is the extension of Java code files?

Java MCQ: What is the extension of Java code files? a) .js b) .txt c) .class d) .java Answer: d) .java Explanation: Java source code files have the extension .java. These files are compiled by the Java compiler into bytecode files with the extension .class. Reference links: https://www.rameshfadatare.com/learn-java-programming/ https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

What is the extension of Java code files? Read More »

Scroll to Top