Core Java Fundamentals

Learn Java from the ground up: how the JVM runs your code, data types, operators, conditionals, loops, methods, arrays, strings, object-oriented programming and exceptions. Every lesson traces a real program line by line.

Java Basics

  1. Java History and Features: Learn about Java's origin, evolution, and key features that make it popular
  2. JVM, JRE, and JDK: Understanding the Java ecosystem components and their relationships
  3. Java Identifiers and Keywords: Learn the rules for naming variables, methods, and classes in Java, and understand the role of reserved words.

Data Types & Variables

  1. Primitive Data Types: Understanding Java's 8 primitive data types and their characteristics
  2. Non-Primitive Data Types: Explore how non-primitive (or reference) data types like Arrays, Strings, and Classes work in Java, focusing on how they are stored in memory.
  3. Variables and Memory Management: Understanding how Java manages variables in stack and heap memory
  4. Type Casting in Java: Understand how to convert data from one primitive type to another, covering both automatic (implicit) and manual (explicit) conversions.
  5. Variable Scope in Java: Understand the difference between local, instance, and class (static) variables, their lifecycles, and where they are stored in memory.
  6. Constants and Final Keyword: Learn how to create constants and prevent modification of variables, methods, and classes using the "final" keyword in Java.

Operators

  1. Arithmetic Operators: Learn the fundamental arithmetic operators in Java to perform mathematical calculations like addition, subtraction, multiplication, division, and finding remainders.
  2. Relational Operators: Learn how to compare values in Java using relational operators. These operators evaluate the relationship between two operands and return a boolean result (true or false).
  3. Logical Operators (&&, ||, !): Learn how to combine multiple boolean conditions using AND, OR, and NOT operators to create more complex decision-making logic.
  4. Assignment Operators: Learn how to assign and modify values of variables using basic and compound assignment operators.
  5. Increment/Decrement Operators: Learn how to use the pre-increment (++i), post-increment (i++), pre-decrement (--i), and post-decrement (i--) operators in Java.
  6. Bitwise Operators: Learn how to perform operations on the individual bits of integer-type numbers, a fundamental concept for low-level programming and optimization.
  7. Ternary Operator: Learn how to use the ternary operator, a compact, inline conditional for simple if-else logic.
  8. Operator Precedence: Understand the rules that dictate the order of operations in Java expressions, similar to PEMDAS or BODMAS in mathematics.

Conditional Statements

  1. Conditional Statements (if-else): Learn how to make decisions in your code using conditional statements
  2. Switch Statement: Learn how to use the switch statement to control the flow of execution based on the value of a variable or expression.

Loops

  1. For Loop: Learn how to execute a block of code a specific number of times using the for loop.
  2. While Loop: Learn how to repeat a block of code as long as a specified condition is true using the while loop.
  3. Do-While Loop: Learn about the do-while loop, a post-test (or exit-controlled) loop that guarantees the loop body is executed at least once.
  4. Enhanced For Loop (For-Each): Learn a simpler way to iterate over arrays and collections using the enhanced for loop, also known as the for-each loop.
  5. Nested Loops: Learn how to use loops inside other loops to handle more complex repetitive tasks, like working with two-dimensional data or creating patterns.
  6. Break Statement: Learn how to prematurely exit loops and switch statements using the break keyword.
  7. Continue Statement: Learn how to use the "continue" statement to skip the current iteration of a loop and proceed to the next one.

Methods

  1. Methods: Define, Call and Return: Package code into methods, pass values in, and get a result back. Watch each call get its own frame on the stack.
  2. Method Overloading: Several methods can share a name if their parameters differ. Java picks the right one from the arguments you pass.
  3. Pass by Value: Primitives vs References: Java always copies the argument. For an int that is the number; for an array it is the reference, so the method can change the array itself.

Arrays and Text

  1. Arrays: A fixed-size row of values on the heap. Create arrays two ways, fill them with an index, and loop over them with length.
  2. Two-Dimensional Arrays: An array of arrays: rows and columns. Mark cinema seats and count them with nested loops.
  3. StringBuilder: Changeable Text: Strings never change, so building text with + makes many throwaway objects. StringBuilder edits one object in place.
  4. Wrapper Classes and Autoboxing: Integer, Double and friends wrap primitives in objects so they can go into collections. Java converts back and forth automatically, with one trap.

Strings & Objects

  1. Java Strings: Creation and Immutability: A deep dive into how Java strings are created, stored in memory, and why they are immutable.
  2. Object Creation and References: Learn how objects are created and referenced in Java

Object-Oriented Programming

  1. Constructors and this(): Constructors set up a new object. Overload them, and let one call another with this(...) to avoid repeating code.
  2. static: Shared by the Whole Class: A static field belongs to the class, not to any one object. Count how many objects were made while each keeps its own clicks.
  3. Encapsulation: private Fields and Methods: Hide an object's data behind methods so it can never be put into a bad state, like a negative deposit.
  4. Inheritance and super: A Bike is a Vehicle. Reuse the parent's fields and methods, and call its constructor with super(...).
  5. Polymorphism and Overriding: One call, s.area(), runs different code for a Square and a Circle. Java picks the method from the real object, at run time.
  6. Abstract Classes: An abstract class is a partial blueprint: it can hold shared code, but leaves some methods for subclasses to fill in.
  7. Interfaces: An interface is a promise of methods. One class can keep several promises, and be used through any of them.

Exception Handling

  1. Exception Handling: try, catch, finally: Catch errors like division by zero or a bad array index so the program keeps running, and see finally run no matter what.
  2. Custom Exceptions and throws: Make your own exception type, throw it when a rule is broken, and make callers handle it with throws.