LPU Java Unit 1 Lecture 1 MCQ Introduction | LPUCOLAB

LPU Java Unit 1 Lecture 1 MCQ Introduction | LPUCOLAB

LPU_Java_Unit 1_Lecture 1_MCQ_Introduction

1. What is portability offered by Java language?

Answer:
Ability to run the Byte on different machines producing the same behavior and output.


2. Which of the following operating systems can a Java program run?

Answer:
All of the mentioned options.


3. What is the purpose of the 'java' command in the JDK?

Answer:
To execute a Java application.


4. What are the main operations of JVM?

Answer:
1) To load code 2) To Verify code 3) To Executes code 4) To provide runtime environment


5. What is the correct syntax for the Java main method?

Answer:

public static void main(String[] args)

6. Which of the following is not a Java feature?

Answer:
Use of pointers.


7. Which JDK component is responsible for managing the execution of Java applications on different platforms?

Answer:
JVM (Java Virtual Machine).


8. Which component of the JDK is responsible for compiling Java source code into bytecode?

Answer:
javac (Java Compiler).


9. What is Java Virtual Machine (JVM)?

Answer:
It is an abstract machine and a specification which provides a runtime environment for Java bytecode execution.


10. Which is the correct "Hello World" code?

Answer:

class HelloWorld
{
    public static void main(String args[])
    {
        System.out.println("Hello World");
    }
}