Web Design and Development MCQs with Answers
Practice important Web Design and Development MCQs with answers and explanations.
Multiple Choice Questions
Q21: Java program code is compiled into form called
- A: Machine code
- B: Native Code
- C: Byte Code
- D: Source Code
View Answer
C
Q22: In Java, what must the name of the file match?
- A: The main method name
- B: The name of the class
- C: The name of the JDK
- D: The name of the JVM
View Answer
B
Q23: What is the purpose of the Java bytecode verifier?
- A: To convert Java code to machine code
- B: To ensure bytecodes are valid and secure
- C: To compile Java source files
- D: To load Java classes into memory
View Answer
B
Q24: Which phase involves writing the Java program using an editor?
- A: Edit
- B: Compile
- C: Load
- D: Verify
View Answer
A
Q25: Which phase involves the command java Welcome?
- A: Edit
- B: Compile
- C: Load
- D: Execute
View Answer
C
Q26: What does the System.out.println("Hello World"); statement do?
- A: Declares a class
- B: Compiles the program
- C: Prints "Hello World" to the console
- D: Loads the program into memory
View Answer
C
Q27: Why is the main method in Java declared static?
- A: To allow it to be called without creating an instance
- B: To make it private
- C: To ensure it returns a value
- D: To ensure it is not overridden
View Answer
A
Q28: Which environment variable is modified to permanently set the Java path?
- A: JAVA_HOME
- B: PATH
- C: CLASSPATH
- D: JRE_HOME
View Answer
B
Q29: Which of these are valid declarations for the main method?
- A: public void main();
- B: public static void main(String args[]);
- C: static public void main(String);
- D: public static int main(String args[]);
View Answer
B
Q30: What is the purpose of the + operator in Java?
- A: Concatenate strings
- B: Subtract integers
- C: Multiply numbers
- D: Divide numbers
View Answer
A