Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.
Exam details
The Java Virtual Machine (JVM) is an abstract computing machine that executes Java bytecode. It provides platform independence by translating bytecode into native machine instructions at runtime, enabling the "Write Once, Run Anywhere" principle.
JDK (Java Development Kit) includes tools for developing Java programs.
JRE (Java Runtime Environment) provides libraries and JVM to run Java applications.
JVM (Java Virtual Machine) executes the bytecode. Relationship: JDK ⊃ JRE ⊃ JVM.
Encapsulation is the practice of keeping fields private and providing access through public getter and setter methods. This protects the internal state of an object and enforces data hiding.
Example: private int age; public int getAge() { return age; }
Inheritance allows a class to acquire properties and methods of another class using the extends keyword. Java supports single inheritance for classes.
Example: class Dog extends Animal { }