JV

Java Fundamentals

19 lessons

Progress0%
1. Introduction to Java
1What is Java?
2. Variables and Data Types
1Primitive Types
3. Control Flow
ConditionalsLoops
4. Methods
Defining MethodsMethod Overloading
5. Object-Oriented Programming
Classes and ObjectsInheritanceInterfaces and Abstract Classes
6. Collections
ArrayList and LinkedListHashMap and HashSet
7. Exception Handling
Checked & Unchecked Exceptionstry-with-resources & Custom Exceptions
8. Generics
Generic Classes & MethodsWildcards & Type Erasure
9. Modern Java
Lambdas & Functional InterfacesStream API & Optional
10. File I/O
java.nio.file APIBuffered I/O & try-with-resources
All Tutorials
JavaIntroduction to Java
Lesson 1 of 19 min
Chapter 1 · Lesson 1

What is Java?

Java is a class-based, object-oriented programming language designed to have as few implementation dependencies as possible. Created by James Gosling at Sun Microsystems in 1995, Java follows the "write once, run anywhere" principle.

Key Features:

  • Platform Independent: Compiles to bytecode that runs on the JVM
  • Object-Oriented: Everything is an object (except primitives)
  • Strongly Typed: Types are checked at compile time
  • Automatic Memory Management: Garbage collection handles memory
  • Multi-threaded: Built-in support for concurrent programming

Where Java is Used:

  • Enterprise applications
  • Android development
  • Web backends (Spring, Jakarta EE)
  • Big data (Hadoop, Spark)
  • Scientific applications

Java Versions: Java follows a 6-month release cycle. LTS versions (8, 11, 17, 21) are recommended for production.

Code Examples

Hello Worldjava
// Every Java program needs a class
public class HelloWorld {
    // Entry point of the program
    public static void main(String[] args) {
        // Print to console
        System.out.println("Hello, World!");
        
        // Variables must declare types
        String name = "Java";
        int version = 21;
        
        System.out.println("Welcome to " + name + " " + version + "!");
        
        // Using printf for formatted output
        System.out.printf("Version: %d%n", version);
    }
}

Every Java application must have a main method as the entry point. The class name must match the filename (HelloWorld.java).

Quick Quiz

1. What does 'write once, run anywhere' mean for Java?

2. What must the Java class name match?

Was this lesson helpful?

OverviewNext