Sitemap

Basic Java : MCQ [ 2150704 ]

2 min readMar 24, 2023

--

  1. Which of the following is not a feature of Java? a) Platform independence b) Object-oriented programming c) Dynamic binding d) Multiple inheritance

Answer: d) Multiple inheritance

https://play.google.com/store/apps/details?id=com.javamcq.programs.interviewcomputerbitsdaily

  1. Which of the following is not a primitive data type in Java? a) byte b) int c) float d) string

Answer: d) string

  1. What is Byte Code in Java? a) The code generated by a Java compiler b) The code generated by a C++ compiler c) The code generated by a Python compiler d) The code generated by a PHP compiler

Answer: a) The code generated by a Java compiler

  1. What is the purpose of the Java Virtual Machine (JVM)? a) To compile Java code into Byte Code b) To execute Byte Code on any platform c) To debug Java code d) To write Java code

Answer: b) To execute Byte Code on any platform

  1. What does JDK stand for in Java? a) Java Development Kernel b) Java Development Kit c) Java Debugging Kit d) Java Deployment Kit

Answer: b) Java Development Kit

  1. Which of the following is not a relational operator in Java? a) < b) <= c) != d) **

Answer: d) **

  1. Which control statement is used to execute a block of code repeatedly until a condition is met? a) if-else b) switch c) while d) for

Answer: c) while

  1. Which control statement is used to execute a block of code a fixed number of times? a) while b) do-while c) for d) switch

Answer: c) for

  1. Which control statement is used to exit a loop prematurely? a) break b) continue c) return d) exit

Answer: a) break

Get Willamswhite’s stories in your inbox

Join Medium for free to get updates from this writer.

https://play.google.com/store/apps/details?id=com.javamcq.programs.interviewcomputerbitsdaily

  1. Which control statement is used to skip to the next iteration of a loop? a) break b) continue c) return d) exit

Answer: b) continue

https://play.google.com/store/apps/details?id=com.javamcq.programs.interviewcomputerbitsdaily

--

--