Java Programming MCQ Trivia Test! Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Ekkoo
E
Ekkoo
Community Contributor
Quizzes Created: 4 | Total Attempts: 2,539
Questions: 10 | Attempts: 1,926

SettingsSettingsSettings
Java Programming MCQ Trivia Test! Quiz - Quiz

.


Questions and Answers
  • 1. 

    The Java compiler generates

    • A.

      Source code

    • B.

      Bytecode

    • C.

      Executable file

    • D.

      Image file

    Correct Answer
    B. Bytecode
    Explanation
    The Java compiler generates bytecode. Bytecode is a low-level representation of the Java source code that can be executed by the Java Virtual Machine (JVM). It is a platform-independent format that allows Java programs to run on any system with a compatible JVM. The bytecode is generated from the source code during the compilation process and is stored in .class files. These .class files can then be executed by the JVM to produce the desired output.

    Rate this question:

  • 2. 

    Which of the following features make Java a favourite for internet?

    • A.

      Portability and security

    • B.

      Multithreaded

    • C.

      Object Oriented

    • D.

      Simple

    Correct Answer
    A. Portability and security
    Explanation
    Java is a favorite for the internet because of its portability and security features. Portability allows Java programs to run on any platform without the need for recompilation, making it ideal for internet applications that need to be accessible across different devices and operating systems. Additionally, Java's built-in security features, such as the sandbox environment and automatic memory management, help protect against malicious attacks and ensure the integrity of internet applications.

    Rate this question:

  • 3. 

    The Java feature, "write once, run anywhere", is termed as

    • A.

      Object-oriented

    • B.

      Robust

    • C.

      Multithreaded

    • D.

      Platform independent

    Correct Answer
    D. Platform independent
    Explanation
    The term "write once, run anywhere" refers to the Java feature of being able to write code on one platform and run it on any other platform without the need for recompilation. This means that Java programs can be created on one operating system and then executed on any other operating system that supports Java, making it platform independent.

    Rate this question:

  • 4. 

    Which one of the following is true about the Java platform?

    • A.

      Compiler compiles source code to a .class file

    • B.

      Compiler compiles source code to machine code

    • C.

      Interpreter interprets the source code to .class file

    • D.

      Interpreter interprets the source code to machine code

    Correct Answer
    A. Compiler compiles source code to a .class file
    Explanation
    The Java platform uses a compiler to compile the source code into a .class file. This .class file contains bytecode, which is a low-level representation of the source code that can be understood by the Java Virtual Machine (JVM). The JVM then interprets this bytecode and executes it on the machine. Therefore, the correct answer is that the compiler compiles the source code to a .class file.

    Rate this question:

  • 5. 

    The feature of Java which makes it possible to run many jobs simultaneously is known as

    • A.

      Dynamic

    • B.

      Distributed

    • C.

      Multithreaded

    • D.

      Architecture neutral

    Correct Answer
    C. Multithreaded
    Explanation
    Multithreading is a feature in Java that allows multiple threads to run concurrently within a single program. Each thread represents a separate flow of control, allowing multiple tasks to be executed simultaneously. This feature enhances the efficiency and responsiveness of Java programs by enabling concurrent execution of multiple jobs or tasks. Therefore, the correct answer is "Multithreaded".

    Rate this question:

  • 6. 

    Javac.exe found in the Java Development Kit (JDK) is known as

    • A.

      Interpreter

    • B.

      Compiler

    • C.

      Debugger

    • D.

      Executable

    Correct Answer
    B. Compiler
    Explanation
    The correct answer is "Compiler" because javac.exe is a tool provided by the Java Development Kit (JDK) that is used to compile Java source code into bytecode. A compiler translates the source code into a lower-level language that can be executed by the computer. Therefore, javac.exe is responsible for converting Java code into bytecode that can be executed by the Java Virtual Machine (JVM).

    Rate this question:

  • 7. 

    The location of Java compiler and interpreter in JDK is in

    • A.

      C:\java

    • B.

      C:\Program Files\Java

    • C.

      C:\Program Files\Java\jdk1.6.0\bin

    • D.

      C:\ jdk1.6.0\bin

    Correct Answer
    C. C:\Program Files\Java\jdk1.6.0\bin
    Explanation
    The correct answer is C:\Program Files\Java\jdk1.6.0\bin. This is the correct location for the Java compiler and interpreter in the JDK (Java Development Kit) installation. The bin folder within the jdk1.6.0 directory contains the executable files for the Java compiler and interpreter, which are necessary for compiling and running Java programs.

    Rate this question:

  • 8. 

    What is Java API?

    • A.

      An application to display a Java program output.

    • B.

      A collection of ready-made software components in Java.

    • C.

      It is a Java application used to interface two or more systems.

    • D.

      Java applet interface.

    Correct Answer
    B. A collection of ready-made software components in Java.
    Explanation
    The Java API refers to a collection of pre-built software components that are available for use in Java programming. These components provide ready-made functionality and can be easily integrated into Java programs, saving developers time and effort. The Java API includes a wide range of classes and methods that cover various areas such as file handling, networking, database connectivity, user interface development, and more. By utilizing the Java API, developers can leverage the existing codebase and build robust applications efficiently.

    Rate this question:

  • 9. 

    Which of the following is true about a Java applet?

    • A.

      It is a tiny Java program dynamically downloaded across the internet.

    • B.

      It needs a Java enabled browser to display.

    • C.

      It is an active program that reacts to the user inputs and dynamically changes.

    • D.

      All of the above

    Correct Answer
    D. All of the above
    Explanation
    A Java applet is a small program written in Java that can be downloaded from the internet and run on a Java-enabled browser. It is designed to be interactive and can react to user inputs, dynamically changing its behavior or appearance. Therefore, all of the given statements are true about a Java applet.

    Rate this question:

  • 10. 

    What are the input and outputs of a Java compiler?

    • A.

      Source code; byte code

    • B.

      Byte code; native code

    • C.

      Source code; native code

    • D.

      Native code; source code

    Correct Answer
    A. Source code; byte code
    Explanation
    A Java compiler takes the source code written in Java programming language as input and converts it into byte code. The byte code is a low-level representation of the source code that can be executed by the Java Virtual Machine (JVM). Therefore, the input of a Java compiler is the source code, and the output is the byte code.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 14, 2011
    Quiz Created by
    Ekkoo
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.