GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Java Tutorial
  • Advanced Java
  • Interview Questions
  • Exercises
  • Examples
  • Quizzes
  • Projects
  • Cheatsheet
  • DSA in Java
  • Java Collection
  • Introduction
  • Creating First Java Application in IntelliJ IDEA
  • JDK vs JRE vs JVM
  • Input/Output

This view

  • Original page
  • New address

GeezerVison is showing www.geeksforgeeks.org — Java Tutorial - Learn Java Programming - GeeksforGeeks

geeksforgeeks
search icon
  • Courses
  • Tutorials
  • Interview Prep
  • Java Tutorial
  • Advanced Java
  • Interview Questions
  • Exercises
  • Examples
  • Quizzes
  • Projects
  • Cheatsheet
  • DSA in Java
  • Java Collection

Java Tutorial

Last Updated : 4 Nov, 2026

Java is a high-level, object-oriented programming language used to develop web, mobile, desktop, and enterprise applications. It is known for its platform independence, security, reliability, and extensive library support.

  • Java follows the Write Once, Run Anywhere (WORA) principle, allowing compiled code to run on any platform with a compatible JVM.
  • Syntax and structure are similar to C-based languages like C++ and C#.

Basics

Before starting with Java basics, first set up the Java development environment. Install the JDK and choose an IDE such as IntelliJ IDEA or Eclipse to write, run, and debug Java programs.

  • Introduction
  • Creating First Java Application in IntelliJ IDEA
  • JDK vs JRE vs JVM
  • Input/Output
  • Identifiers
  • Keywords
  • Variables and Data Types
  • Wrapper Classes
  • Operators
  • Decision Making
  • Loops and Jump Statements
  • Project: Number Guessing Game

Methods

Java methods are reusable blocks of code that perform specific tasks and help organize your program. They improve code readability, reduce repetition, and make debugging easier.

  • Introduction
  • Static Methods vs Instance Methods
  • Access Modifiers
  • Command Line Arguments
  • Variable Arguments (Varargs)

Arrays

Java arrays are containers that store multiple values of the same data type in a single variable. They provide an efficient way to manage and access collections of data using index-based positions.

  • Introduction
  • Multi-Dimensional Arrays
  • Jagged Arrays
  • Arrays Class
  • Final Arrays
  • Projects: Tic-Tac-Toe Game

Strings

Java Strings represent sequences of characters and are widely used in text processing. They are immutable, meaning once created, their values cannot be changed.

  • Introduction
  • .equals() vs ==
  • String Methods
  • String Class
  • StringBuffer Class
  • StringBuilder Class
  • Strings vs StringBuffer vs StringBuilder

OOP Concepts

Java follows the Object-Oriented Programming (OOP) paradigm, which organizes code into classes and objects. Core OOP principles like inheritance, encapsulation, polymorphism, and abstraction make Java modular and scalable.

  • Introduction
  • this Keyword
  • super Keyword
  • Encapsulation
  • Inheritance
  • Polymorphism
  • Abstraction
  • Object Class
  • Packages
  • Project: Simple Banking Application

Interfaces

Java interfaces define a contract that classes must follow, specifying method signatures without implementations. They enable abstraction and support multiple inheritance in Java through a clean, structured approach.

  • Interfaces
  • Class vs Interface
  • Functional Interface
  • Nested Interface
  • Marker Interface
  • Project: Employee Management System

Exception Handling

Java Exception Handling is a mechanism to handle runtime errors, ensuring the program runs smoothly without crashing. It uses keywords like try, catch, throw, throws, and finally to manage exceptions.

  • Introduction
  • Try-Catch Block
  • Final, Finally and Finalize
  • Throw and Throws
  • Customized Exception Handling
  • Chained Exceptions
  • Null Pointer Exceptions
  • Exception Handling with Method Overriding

Regex

Java Regex (Regular Expressions) allows pattern matching and text manipulation using the java.util.regex package. It is powerful for validating, searching, and replacing strings based on specific patterns.

  • Introduction
  • Matcher Class
  • Character Class
  • Quantifiers

Memory Allocation

Java Memory Allocation refers to how memory is assigned to variables, objects, and classes during program execution. It involves stack and heap memory, with the JVM managing allocation and garbage collection automatically.

  • Java Memory Management
  • How Java Objects Stored in Memory?
  • Types of Memory Areas Allocated by JVM
  • Stack vs Heap Memory Allocation
  • Garbage Collection
  • Types of JVM Garbage Collectors
  • Memory Leaks

Generics

Generics provide a way to create classes, interfaces, and methods that work with different data types while ensuring type safety and reducing the need for explicit type casting.

  • Generic Classes
  • Wildcards
  • Bounded Types
  • Type Erasure

Collections

Java Collections provide a framework for storing and manipulating groups of objects efficiently. It includes interfaces like List, Set, and Map, along with classes like ArrayList, HashSet, and HashMap.

  • Collections Class
  • Collection Interface
  • List Interface
  • Set Interface
  • Queue Interface
  • Map Interface
  • Iterator
  • Comparator Interface
  • Comparable Interface
  • Collection Framework Complete Tutorial
  • Project: Face Detection System

Java 8+ Features

Java 8 and later versions introduced powerful features such as Lambda Expressions, Stream API, Functional Interfaces, Optional, the Date and Time API, and other enhancements to make code more concise, readable, and efficient.

  • Lambda Expressions
  • Predicate
  • Consumer
  • Supplier
  • Method References
  • Streams
  • Optional
  • Collectors

Date and Time API

The Java Date & Time API provides modern, immutable classes for handling dates, times, time zones, formatting, and date-time calculations efficiently and accurately.

  • Introduction
  • LocalDate
  • LocalTime
  • LocalDateTime
  • Duration
  • Period
  • DateTimeFormatter

Multithreading and Synchronization

Java Multithreading allows concurrent execution of two or more threads, enabling efficient CPU utilization and faster program performance. It is commonly used for tasks that required parallel processing and responsiveness from multiple ends.

  • Introduction
  • Thread.start() vs Thread.run() Method
  • Main Thread
  • Thread Priority
  • Synchronization and Thread Safety
  • Locks and Reentrant Lock
  • Deadlock
  • Thread Pools
  • Multithreading Complete Tutorial
  • Project: Snake Game

File Handling

Java File Handling enables programs to create, read, write, and manipulate files stored on the system. It uses classes from the java.io and java.nio packages for efficient file operations.

  • Introduction to Java IO
  • Reader Class
  • Writer Class
  • File Handling
  • BufferedReader Input Stream
  • BufferedReader Output stream
  • FilePermission Class
  • FileDescriptor Class
  • Project: Text Editor

Networking

Java Networking enables communication between devices over a network using classes from the java.net package. It supports protocols like TCP and UDP for building client-server applications and data exchange.

  • Introduction
  • Socket Programming
  • Server Socket Class
  • URL Class and Methods
  • Project: Chat Application

Java Database Connectivity(JDBC)

Java Database Connectivity (JDBC) enables Java applications to connect and interact with databases for storing and retrieving data efficiently.

  • Introduction
  • JDBC Driver
  • JDBC Connection
  • Types of Statements in JDBC
  • Transactions
  • ResultSet
  • Metadata
  • Connection Pooling

Quiz and Coding Practice

Practice chapter-wise Java quizzes and solve coding problems to improve your programming knowledge, logical thinking, and problem-solving skills.

  • Java Topic-wise Quiz
  • Coding Practice Problems

Interview Questions

This section provides a collection of commonly asked Java interview questions and answers to help you prepare for technical interviews.

  • Core Java Interview Questions and Answers
  • Advanced Java Interview Questions and Answers

Important Links

  • Comparison of various programming languages
  • Companies That Use Java
  • Careers and Jobs in Java
Comment

Explore

    Basics
    • Introduction3 min read
    • Variables2 min read
    • Data Types7 min read
    • Operators7 min read
    • Decision Making5 min read
    • Methods7 min read
    • Arrays7 min read
    • Strings5 min read
    OOP & Interface
    • Introduction6 min read
    • Constructors6 min read
    • Encapsulation3 min read
    • Inheritance8 min read
    • Polymorphism5 min read
    • Abstraction5 min read
    • Interfaces8 min read
    Collections
    • Collection class9 min read
    • Collection Interface5 min read
    • List Interface8 min read
    • Set Interface5 min read
    • Queue Interface5 min read
    • Map Interface in Java6 min read
    • Iterator4 min read
    Advance Java Concepts
    • Exception handling6 min read
    • Java Multithreading Tutorial3 min read
    • Synchronization in Java9 min read
    • File handling6 min read
    • Method References3 min read
    • Java 8 Stream Tutorial7 min read
    • Memory Management4 min read
    • Garbage Collection in Java6 min read
    • Networking6 min read
    • JDBC5 min read
    Practice Java
    • Interview Questions15+ min read
    • Programs6 min read
    • Practice Problems5 min read
    • Quiz1 min read
    • Project Ideas15+ min read
    Courses
    • Java Backend Course2 min read
    • Placement 360 Course2 min read
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.