Basic Programs
First programs, constructors, methods and simple class examples.
My First Java Example in Java
Learn My First in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Constructor Example in Java
Learn Constructor in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Parametrized Method Example in Java
Learn Parametrized Method in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Static Class and Its Usage in Java
Learn Static Class and Its Usage in in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Static Function or Method and Its Usage in Java
Learn Static Function or Method and Its Usage in in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Default and Parameterized Constructor Example in Java
Learn Default and Parameterized Constructor in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Constructor Chaining Example in Java
Learn Constructor Chaining in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Singleton Class using Private Constructor Example in Java
Learn Singleton Class Using Private Constructor in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Constructor Overloading Example in Java
Learn Constructor Overloading in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Simple Class and Array of Object Example in Java
Learn Simple Class and Array of Object in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Multiple Inheritance using Interface Example in Java
Learn Multiple Inheritance Using Interface in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Single Inheritance Example in Java
Learn Single Inheritance in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Multilevel Inheritance Example in Java
Learn Multilevel Inheritance in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Hierarchical Inheritance Example in Java
Learn Hierarchical Inheritance in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Create Matrix Example in Java
Learn Create Matrix in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Sum of Three Numbers Example in Java
Learn Sum Of Three Numbers in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Find All Substrings of a Given String Example in Java
Learn Find all Substrings of a given string in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Heap Sort Example in Java
Learn Heap Sort in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Twin Prime Example in Java
Learn Twin Prime in Java with explanation, complete source code, step-by-step walkthrough and sample output.
Java Scanner Class Example in Java
Learn how to read user input in Java using the Scanner class with nextInt, nextLine and nextDouble, including a complete example and sample output.
JDK JRE JVM Explained Example in Java
Understand JDK, JRE and JVM roles in Java with a simple program showing compilation and execution flow, plus a clear comparison table.