1. Origin of Java Q: Who developed the Java programming language? A) Dennis Ritchie B) James Gosling C) Guido van Rossum D) Bjarne Stroustrup Answer: B 2. Features of Java Q: Which of the following is NOT a feature of Java? A) Platform independence B) Garbage collection C) Low-level memory manipulation D) Object-oriented Answer: C 3. Java Elements Q: Which of the following is a valid identifier in Java? A) 1variable B) @variable C) variable1 D) int Answer: C 4. Primitive Data Types Q: Which data type is used to store true or false values in Java? A) int B) char C) boolean D) float Answer: C 5. Control Statements - if-else Q: What will be the output of the following code? int num = 10; if (num > 5) { System.out.println("Greater"); } else { System.out.println("Smaller"); } A) Smaller B) Greater C) Compiler Error D) None of the above Answer: B 6. Conditional Operator Q: What does the following e...
Popular posts from this blog
Java MCQ
1. Which provides runtime environment for java byte code to be executed? (A) JDK (B)JVM (C) JRE (D) JAVAC 2. What is byte code in Java? (A) Code generated by a Java compiler (B) Code generated by a Java Virtual Machine (C) Name of Java source code file (D) Block of code written inside a class 3. Which of the following are not Java keywords ? (A) double (B) switch (C) then (D) instanceof 4. Hot Java is a ______________________. (A)Application in Java (B)JVM for Java Application (C)Java enabled browser (D)Later version of Java Language 5. Which of the following commands will compile a Java source file ...
Comments
Post a Comment