D
DevPrepSystematic Prep
JAVA · EASY CODEX

Java Interview Questions — Easy

Core concepts, definitions, basic syntax, and first principles expected in round 1 screening.

50 Theory Questions7 Implementation Folios5 Free Model Answers
THEORY QUESTIONS & SOLUTIONSShowing 5 of 50 questions
Q1What is Java? Why is it considered platform-independent?
  • Java: A high-level, class-based, object-oriented programming language.
  • Platform Independence: Java uses a "Write Once, Run Anywhere" (WORA) model. The Java compiler (javac) converts source code (.java) into intermediate bytecode (.class). The Java Virtual Machine (JVM) interprets or compiles this bytecode into native machine code specific to the host operating system.
Q2Explain the differences between JDK, JRE, and JVM.
  • JVM (Java Virtual Machine): The execution engine that runs Java bytecode on the host OS.
  • JRE (Java Runtime Environment): JVM + Libraries + core files required to run compiled Java applications.
  • JDK (Java Development Kit): JRE + Development Tools (compiler javac, debugger jdb, packager).
Q3What is the JIT Compiler and how does it work?
  • JIT (Just-In-Time) Compiler: A component of the JVM's execution engine.
  • Mechanism: Instead of interpreting bytecode line-by-line repeatedly, JIT compiles frequently executed code blocks ("hotspots") directly into native machine code at runtime, caching it for subsequent executions to boost performance.
Q4List the primitive data types in Java, their sizes, and default values.
  • byte: 1 byte, default 0.
  • short: 2 bytes, default 0.
  • int: 4 bytes, default 0.
  • long: 8 bytes, default 0L.
  • float: 4 bytes, default 0.0f.
  • double: 8 bytes, default 0.0d.
  • char: 2 bytes (Unicode), default '\u0000'.
  • boolean: JVM-dependent (effectively 1 bit/byte), default false.
Q5Explain the concept of Autoboxing and Unboxing.
  • Autoboxing: Automatic conversion of primitive types to their corresponding wrapper classes by the Java compiler (e.g., int to Integer).
  • Unboxing: The reverse process—automatic conversion of wrapper class instances back into primitive types (e.g., Double to double).

Unlock the remaining 52 Java (Easy) questions

You've completed the 5 free sample questions. Get unrestricted lifetime access to every question, model answer, implementation challenge, and all 27+ technologies for a single payment.

₹399 India / $9 International · One-time settlement · Zero subscription

CROSS-DIFFICULTY NAVIGATION

Continue Preparing Java

Java Interview Questions (Easy) | DevPrep | DevPrep