Skip to main content

Basic Programs

First programs, constructors, methods and simple class examples.

1
basic programs

My First Java Example in Java

My First explained in Java, with a complete example program, its sample output, and a clear code walkthrough.

2
basic programs

Constructor Example in Java

A constructor in a class is a special type of method called to create an object, It has the same name as that of the Class.

3
basic programs

Parametrized Method Example in Java

A method (or message) in object-oriented programming (OOP) is a procedure associated with an object class. A Java example with source code and sample output.

4
basic programs

Static Class and Its Usage in Java

Static Class and Its Usage explained in Java, with a complete example program, its sample output, and a clear code walkthrough.

5
basic programs

Static Function or Method and Its Usage in Java

A Java example program demonstrating Static Function or Method and Its Usage, complete with the source code and expected sample output.

6
basic programs

Default and Parameterized Constructor Example in Java

Default Constructor: A Constructor with no argument is called default Constructor. A Java example with source code and sample output.

7
basic programs

Constructor Chaining Example in Java

Constructor chaining is calling a constructor from the another constructor of the same class. A Java example with source code and sample output.

8
basic programs

Singleton Class using Private Constructor Example in Java

Singleton Class using Private Constructor in Java: a complete example program with source code and sample output, explained step by step.

9
basic programs

Constructor Overloading Example in Java

A constructor in a class is a special type of subroutine called to create an object. A Java example with source code and sample output.

10
basic programs

Simple Class and Array of Object Example in Java

Simple Class and Array of Object in Java: a complete example program with source code and sample output, explained step by step.

11
basic programs

Multiple Inheritance using Interface Example in Java

A Java example program demonstrating Multiple Inheritance using Interface, complete with the source code and expected sample output.

12
basic programs

Single Inheritance Example in Java

Single inheritance enables a derived class to inherit properties and behavior from a single parent class. A Java example with source code and sample output.

13
basic programs

Multilevel Inheritance Example in Java

A Java example program demonstrating Multilevel Inheritance, complete with the source code and expected sample output.

14
basic programs

Hierarchical Inheritance Example in Java

Hierarchical Inheritance in Java: a complete example program with source code and sample output, explained step by step.

15
basic programs

Create Matrix Example in Java

Create Matrix in Java: a complete example program with source code and sample output, explained step by step.

16
basic programs

Sum of Three Numbers Example in Java

A Java example program demonstrating Sum of Three Numbers, complete with the source code and expected sample output.

17
basic programs

Find All Substrings of a Given String Example in Java

A string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. A Java example with source code and sample output.

18
basic programs

Heap Sort Example in Java

Heapsort is a comparison-based sorting algorithm. A Java example with source code and sample output.

19
basic programs

Twin Prime Example in Java

A twin prime is a prime number that has a prime gap of two. A Java example with source code and sample output.

20
input

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.

21
jdk

JDK JRE JVM Explained Example in Java

JDK JRE JVM Explained explained in Java, with a complete example program, its sample output, and a clear code walkthrough.

Related Topics

Search tutorials