Introduction to Java MCQs Exercise II


Ques 1 Introduction


JRE Stands for_____?
  a) Java Running Engine
  b) Java Running Environment
  c) Just Runtime Environment
  d) Java Runtime Environment


d is the correct option

The Java Runtime Environment (JRE) provides the necessary libraries and JVM to run Java applications.





Ques 2 Introduction


What makes java platform independent?
  a) Object Oriented Programming Language
  b) It support Multi -threading
  c) It is Advanced Programming Language
  d) Java uses bytecode of execution


d is the correct option

Java is platform independent because it compiles code into bytecode, which can be executed on any system with a Java Virtual Machine (JVM). This allows Java programs to run on any device or operating system without modification.





Ques 3 Introduction


Which method executes first in Java Programming?
  a) first method
  b) last method
  c) main() method
  d) both (b) and (c)


c is the correct option

The main() method is the entry point of any Java program. When a Java application is executed, the JVM calls the main() method first to start the program.





Ques 4 Introduction


Which environment variable is used to set the path in Java?
  a) path
  b) JAVA_PATH
  c) JAVA_HOME
  d) HOME


c is the correct option

The JAVA_HOME environment variable is used to specify the directory where the JDK is installed. It helps in setting the path for Java-related tools and libraries.