Skip to content

Java Programming

Master Java Programming with 50 free flashcards. Study using spaced repetition and focus mode for effective learning in Programming.

🎓 50 cards ⏱️ ~25 min Advanced
Study Full Deck →
Share: 𝕏 Twitter LinkedIn WhatsApp

🎯 What You'll Learn

Preview Questions

12 shown

What is the JVM?

Show ▼

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.

What is the difference between JDK, JRE, and JVM?

Show ▼

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.

What are the four pillars of OOP in Java?

Show ▼

Encapsulation – bundling data and methods, restricting direct accessInheritance – a class derives from another classPolymorphism – one interface, many implementationsAbstraction – hiding complex details, showing only essentials

What is encapsulation in Java?

Show ▼

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; }

What is inheritance in Java?

Show ▼

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 { }

What is polymorphism in Java?

Show ▼

Polymorphism lets objects take many forms.
Compile-time (method overloading): same method name, different parameters.
Runtime (method overriding): subclass provides its own implementation of a parent method. Resolved via dynamic method dispatch.

What is abstraction in Java?

Show ▼

Abstraction hides implementation details and shows only functionality. Achieved through:
Abstract classes – declared with abstract keyword, can have both abstract and concrete methodsInterfaces – define a contract of methods a class must implement

What is the difference between an abstract class and an interface?

Show ▼

Abstract class: can have constructors, instance variables, and both abstract and concrete methods. Use extends.
Interface: all methods are implicitly public abstract (before Java 8). Supports multiple inheritance. Use implements. Since Java 8, interfaces can have default and static methods.

What are access modifiers in Java?

Show ▼

Java has four access modifiers:public – accessible from everywhereprotected – accessible within the same package and subclassesdefault (no keyword) – accessible only within the same packageprivate – accessible only within the declaring class

What is the purpose of the static keyword?

Show ▼

The static keyword means the member belongs to the class rather than an instance.
static variables are shared across all instancesstatic methods can be called without creating an objectstatic blocks run once when the class is loadedExample: Math.sqrt(25)

What is the final keyword used for?

Show ▼

final has three uses:Variable: value cannot be changed (constant)Method: cannot be overridden by subclassesClass: cannot be extendedExample: final int MAX = 100;

What is a constructor in Java?

Show ▼

A constructor is a special method called when an object is created. It has the same name as the class and no return type.
Java provides a default no-arg constructor if none is defined.
Example: public MyClass(int x) { this.x = x; }

🎓 Start studying Java Programming

🎮 Study Modes Available

🔄

Flashcards

Flip to reveal

🧠

Focus Mode

Spaced repetition

Multiple Choice

Test your knowledge

⌨️

Type Answer

Active recall

📚

Learn Mode

Multi-round mastery

🎯

Match Game

Memory challenge

Related Topics in Programming

📖 Learning Resources