Skip to content

Java Fundamentals Flashcards - Wyatt's Notes

Java Fundamentals Flashcards

20 interactive flashcards spanning JVM internals to modern Java features. Press Space to flip, rate 1-4.


Intuition

Java is “write once, run anywhere” — code compiles to bytecode that runs on the Java Virtual Machine (JVM), abstracting away the underlying OS. The JVM handles memory management through garbage collection, so you don’t manually allocate/free memory like in C. Java’s type system is statically typed (types checked at compile time) with single inheritance of classes but multiple inheritance of interfaces, balancing safety with flexibility.

How to Use These Flashcards

First pass: Go through all 20 cards without rating — just flip and read. This familiarises you with the content and identifies weak areas.

Rating system: 1 = could not recall, 2 = recalled with difficulty, 3 = recalled correctly, 4 = instant recall. The spaced repetition algorithm shows cards rated 1-2 more frequently.

Code verification: After reviewing JVM internals cards, try writing small Java programs to verify your understanding. Use javap -c to see bytecode and confirm your mental model.

Common Pitfalls

  • NullPointerException: Java’s most infamous runtime error — calling a method on a null reference crashes the program. Always use Optional or null checks.
  • String immutability: Strings in Java are immutable — concatenating strings in a loop creates many temporary objects. Use StringBuilder for performance-critical string operations.
  • Integer caching: Java caches Integer objects from -128 to 127 — comparing cached integers with == works, but larger values require .equals(), leading to subtle bugs.
  • Classpath issues: Forgetting to include dependencies on the classpath causes ClassNotFoundException at runtime. Always verify classpath configuration before running.
  • Thread safety with collections: Using ArrayList or HashMap from multiple threads without synchronisation causes ConcurrentModificationException. Use Collections.synchronizedList or ConcurrentHashMap for thread-safe access.

Study Tips

  • Write small test programs: For each concept (generics, streams, concurrency), write a minimal program that demonstrates it. Hands-on experimentation builds deeper understanding than reading alone.
  • Use javap to inspect bytecode: Running javap -c ClassName reveals what the compiler actually generates. This is invaluable for understanding generics erasure and lambda implementation.
  • Read the Java Language Specification for edge cases: The JLS defines exact behaviour for type inference, overload resolution, and exception handling. When in doubt, the JLS is authoritative.
  • Practise with IntelliJ IDEA: The IDE’s debugger, type inference highlighting, and refactoring tools help you understand Java’s type system visually.
  • Study the Stream API: The Stream API (filter, map, reduce, collect) is essential for modern Java. Write stream-based solutions to common problems to build fluency.

Cross-References

  • Site Home: Main landing page for Java notes.
  • Java Basics: Fundamental Java concepts including types and control flow.
  • Concurrency: Multithreading and concurrent programming.
  • Practice: Practice problems for revision.

Detailed Content

This topic covers the fundamental principles and applications in depth. Each concept is explained with clear definitions, worked examples, and practice problems to reinforce understanding.

Core Concepts

Understanding these core concepts is essential for mastering this topic. They form the foundation for more advanced study and are frequently examined.

Worked Examples

Worked examples demonstrate how to apply the concepts to solve problems. Each example is broken down into clear steps with explanations.

Common Mistakes

  • Rushing through foundational material
  • Not practising problems after reading
  • Failing to connect concepts across topics

Further Reading

Consult the recommended textbooks and additional resources for deeper understanding of this topic.

Detailed Content

This topic covers the fundamental principles and applications in depth. Each concept is explained with clear definitions, worked examples, and practice problems to reinforce understanding.

Core Concepts

Understanding these core concepts is essential for mastering this topic. They form the foundation for more advanced study and are frequently examined.

Worked Examples

Worked examples demonstrate how to apply the concepts to solve problems. Each example is broken down into clear steps with explanations.

Common Mistakes

  • Rushing through foundational material
  • Not practising problems after reading
  • Failing to connect concepts across topics

Further Reading

Consult the recommended textbooks and additional resources for deeper understanding of this topic.

Detailed Content

This topic covers the fundamental principles and applications in depth. Each concept is explained with clear definitions, worked examples, and practice problems to reinforce understanding.

Core Concepts

Understanding these core concepts is essential for mastering this topic. They form the foundation for more advanced study and are frequently examined.

Worked Examples

Worked examples demonstrate how to apply the concepts to solve problems. Each example is broken down into clear steps with explanations.

Common Mistakes

  • Rushing through foundational material
  • Not practising problems after reading
  • Failing to connect concepts across topics

Further Reading

Consult the recommended textbooks and additional resources for deeper understanding of this topic.

Detailed Content

This topic covers the fundamental principles and applications in depth. Each concept is explained with clear definitions, worked examples, and practice problems to reinforce understanding.

Core Concepts

Understanding these core concepts is essential for mastering this topic. They form the foundation for more advanced study and are frequently examined.

Worked Examples

Worked examples demonstrate how to apply the concepts to solve problems. Each example is broken down into clear steps with explanations.

Common Mistakes

  • Rushing through foundational material
  • Not practising problems after reading
  • Failing to connect concepts across topics

Further Reading

Consult the recommended textbooks and additional resources for deeper understanding of this topic.

Detailed Content

This topic covers the fundamental principles and applications in depth. Each concept is explained with clear definitions, worked examples, and practice problems to reinforce understanding.

Core Concepts

Understanding these core concepts is essential for mastering this topic. They form the foundation for more advanced study and are frequently examined.

Worked Examples

Worked examples demonstrate how to apply the concepts to solve problems. Each example is broken down into clear steps with explanations.

Common Mistakes

  • Rushing through foundational material
  • Not practising problems after reading
  • Failing to connect concepts across topics

Further Reading

Consult the recommended textbooks and additional resources for deeper understanding of this topic.