Java — Free Notes & Tutorial
Full Java course covering OOP, inheritance, interfaces, collections and exception handling. Free Java tutorial at SikshaSarovar.
This Java course is part of Siksha Sarovar and is 100% free for students in India — no sign-up required to read. It contains 39 structured lessons with examples, and pairs with our free online compiler and AI tutor.
What you will learn
- Java OOP
- Collections
- Exception handling
- Generics
Course content (39 lessons)
- Programming Languages — Programming Language A language or medium which is used to instruct computer to do some specific tasks is known as Programming language. Types of Programming Language 1. Machine…
- Introduction to Java — JAVA Java is a high-level programming language which is used to develop or test the application. History of JAVA • Java was introduced in year 1995. • The first name of Java was…
- Java Environment & Internals — Java Environment Java involves a compilation and interpretation process. Conversion of High Level To Low Level in Java 1. Java Source File • The file generated by the programmer…
- Printing & Comments — Printing Statements In java mainly two types of printing statements are there: 1. Print Statement • System.out.print(data); • Used only to print the data. It does NOT add a new…
- Tokens in Java — Tokens The smallest unit of programming language which is used to compose the instruction is known as Token. There are 6 types: 1. Keywords 2. Identifiers 3. Separators 4.…
- Variables & Data Types — Variables A variable is a container which is used to store the data or value. Data Types 1. Primitive Data Types (Keywords, store values) • byte : -128 to 127 • short : -32768 to…
- Type Casting — Type Casting The process of converting one type of data into another type is known as Type Casting. 1. Primitive Type Casting Widening (Implicit) : • Converting smaller range data…
- Operators — Operators are predefined symbols used to perform specific tasks. Classification 1. Arithmetic : + , - , , / (Quotient), % (Remainder) 2. Relational : == , != , , < , = , <=…
- Control Statements - Decision — Decision statements define the flow of execution based on conditions. if Statement Executes block if condition is true. if-else Statement Executes if block if true, otherwise else…
- Control Statements - Looping — Looping statements are used to execute a block of instructions repeatedly. 1. While Loop Entry-controlled loop. Checks condition first. 2. Do-While Loop Exit-controlled loop.…
- Basic Methods — A Method is a set of instructions used to perform specific tasks. Syntax [access mod] [modifier] return type methodName(parameters) { body } Types 1. No-Argument Method : void…
- Access Modifiers — Access modifiers strictly defines the accessibility scope of members. Types & Scope 1. private : Within the class only. 2. default (no keyword): Within the package only. 3.…
- Static vs Non-Static — Static (Class Members) • Prefixed with static keyword. • Loaded once in Static Pool Area . • Can be accessed via Class Name (e.g., ClassName.variable ). • Static Context : Cannot…
- Memory Management — Java Runtime Memory Areas 1. Method Area : Stores method code and class structures. 2. Heap Area : Stores Objects (Instances). 3. Stack Area : Stores method execution frames and…
- Objects & Classes — Object • Any entity that has attributes and behaviors. • In Java, an Object is a block of memory in the Heap Area representing a real-world entity. • Also known as an Instance .…
- Constructors Detailed — Constructor A constructor is a special type of non-static method whose name is the same as the class name but it does not have a return type. Syntax: [modifier]…
- Encapsulation — Encapsulation The process of binding state (attributes) and behavior (methods) together. It enables Data Hiding . Data Hiding Restricting direct access to data members to protect…
- Relationships — Relationships Connection between two objects. 1. Has-A Relationship (Association) Dependency where one object has another. • Aggregation : Weak bond. Objects can exist…
- Inheritance — Inheritance Process of acquiring properties of one class by another. Keywords: • extends : Class to Class. • implements : Class to Interface. Types 1. Single : A - B 2. Multilevel…
- Polymorphism & Casting — Non-Primitive Type Casting Converting one reference type to another. 1. Upcasting (Generalization) • Child object to Parent reference. • Implicit. • Parent p = new Child(); •…
- Packages — Package Group of related classes and interfaces. Folder structure. Types: 1. Built-in : java.lang , java.util , java.io . 2. User-defined : package com.company.module; Importing:…
- Object Class — Object Class • Root of the class hierarchy. Every class inherits Object . • Present in java.lang . Important Methods: 1. toString() : String representation. 2. equals(Object o) :…
- Polymorphism — Polymorphism (poly = many, morph = form). It is the ability of an object to exhibit more than one form with the same name. For understanding: • One name → multiple forms • One…
- Abstraction — Abstraction It is the design process of hiding the implementation and showing only the functionality (declaration) to the user. Ways to Achieve 1. Abstract Classes (0 to 100%…
- Interfaces — Interface A component used to achieve 100% Abstraction and Multiple Inheritance . • Syntax: interface InterfaceName { ... } • Compiled to a .class file. Members of Interface…
- Final Keyword — Final Keyword Final is a modifier used to restrict usage. It is applicable to Class, Variable, and Method. 1. Final Class • Effect : Cannot be inherited (Prevent Inheritance). •…
- Arrays — Array An array is a continuous block of memory used to store multiple homogeneous (same type) values. In Java, Array is an Object. Characteristics • Fixed Size : Defined at…
- Wrapper Classes — Wrapper Classes In Java, every primitive data type has a corresponding class which works like a wrapper. It provides a mechanism to wrap primitive data into an object. • All…
- Exception Handling — Exception Definition An unexpected problem/event that occurs during the execution of a program (Runtime) which stops the normal flow. • Root Class : java.lang.Throwable . • Object…
- Collection Framework — Collection Framework The Collection Framework provides a unified architecture for storing and manipulating a group of objects . It is located in the java.util package. Why…
- List Interface — List Interface List is a child interface of Collection. It represents an ordered collection of objects. Key Features : 1. Insertion Order : Preserved (Elements appear in the order…
- Set Interface — Set Interface Set is a child interface of Collection that does NOT allow duplicates . Key Features : 1. Uniqueness : Only unique elements are stored. 2. Insertion Order : Not…
- Map Interface — Map Interface Map is NOT a child of Collection Interface. It stores data in Key-Value pairs . Key Features : 1. Key : Must be Unique . If duplicated, old value is replaced. 2.…
- Queue & Deque — Queue Interface Represents a collection designed for holding elements prior to processing. • Order : Typically FIFO (First In First Out). • Methods : - add() : Throws exception if…
- Cursors & Utility Classes — Cursors in Java Used to retrieve elements from Collection objects one by one. 1. Iterator (Universal Cursor) • Applicable for all Collection classes . • Capabilities: Read and…
- Comparable vs Comparator — Sorting Collections To sort a List of objects (e.g., Student), Java needs to know the sorting logic. 1. Comparable Interface • Package : java.lang • Method : public int…
- Lambdas & Functional Interfaces — Why Lambdas? Before Java 8, passing behaviour around meant writing verbose anonymous inner classes. Lambdas let you treat a single-method action as a value — shorter, clearer, and…
- Streams API — Filter, Map, Reduce — What is a Stream? A Stream is a pipeline of operations on a sequence of elements. It does not store data — it computes on demand. Streams are great for expressing "do X to every…
- Capstone — Java Best Practices & Mini-Projects — Best Practices You Should Already Be Using 1. Naming : ClassName , methodName , CONSTANT NAME , variableName . Names that tell a story beat comments. 2. One responsibility per…
Programming Languages
Programming Language
A language or medium which is used to instruct computer to do some specific tasks is known as Programming language.
Types of Programming Language
- Machine Level Language (Low-Level Language)
- Assembly Level Language (Mid-Level Language)
- High Level Language
1. Machine Level Language
• The language which is easily readable, understandable and executable by the machine or computer is known as machine level language. • This is also known as Low-Level Language. • Example: Binary Language (0 and 1).
2. Assembly Level Language
• The language which provides set of pre-defined words to do some specific tasks is known as Assembly level language. • Those pre-defined words are known as Mnemonics Ex: ADD, SUB, MOV, etc.
- ADD for Addition
- SUB for Subtraction
- MOV for move data from one memory location to another.
• To convert these pre-defined words into machine level language one software is used which is known as Assembler. • It is also known as Mid-Level Language. • Example: Instruction set of 8086 Architecture.
3. High Level Language
• The language which is easily readable, understandable and executable by the programmer is known as High Level Language. • The languages are generally used to develop the software or Application. • Example: C, C++, C#, Java, PHP and Python.
Introduction to Java
JAVA
Java is a high-level programming language which is used to develop or test the application.
History of JAVA
• Java was introduced in year 1995. • The first name of Java was OAK. • It was introduced by Sun Microsystems. • Now it is owned by Oracle. • Father of Java is James Gosling.
Features of JAVA
• Platform Independent Language • Portable • Robust • Interpreted • Architectural Neutral • Dynamic • Distributed • High Performance • Object Oriented • Multi-Threaded • Simple • Secure
Platform Independence
Platform is nothing but combination of operating system and processor (Ex: Windows 64-bit, Mac, Linux).
Platform Dependency: If a software is developed on one platform which can be used only on the same platform, it is known as platform dependent (e.g., C, C++). Java is Platform Independent because it runs on the JVM.
Frequently asked questions
Is the Java course really free?
Yes. The entire Java course on Siksha Sarovar is free to read with no account required. You can optionally sign in with Google to save your progress.
Do I get a certificate for Java?
Yes — finish the lessons and pass the quiz to earn a free, verifiable certificate you can share on LinkedIn or with recruiters.
Can I run code while learning?
Yes. The built-in online compiler runs C, C++, Python, Java, PHP, JavaScript, C# and SQL directly in your browser — no installation needed.