Browse topics
Java Basics
Basic Programs
First programs, constructors, methods and simple class examples.
basic programsMy First Java Example in JavaMy First explained in Java, with a complete example program, its sample output, and a clear code walkthrough.basic programsConstructor Example in JavaA 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.basic programsParametrized Method Example in JavaA 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.basic programsStatic Class and Its Usage in JavaStatic Class and Its Usage explained in Java, with a complete example program, its sample output, and a clear code walkthrough.basic programsStatic Function or Method and Its Usage in JavaA Java example program demonstrating Static Function or Method and Its Usage, complete with the source code and expected sample output.basic programsDefault and Parameterized Constructor Example in JavaDefault Constructor: A Constructor with no argument is called default Constructor. A Java example with source code and sample output.basic programsConstructor Chaining Example in JavaConstructor chaining is calling a constructor from the another constructor of the same class. A Java example with source code and sample output.basic programsSingleton Class using Private Constructor Example in JavaSingleton Class using Private Constructor in Java: a complete example program with source code and sample output, explained step by step.basic programsConstructor Overloading Example in JavaA constructor in a class is a special type of subroutine called to create an object. A Java example with source code and sample output.basic programsSimple Class and Array of Object Example in JavaSimple Class and Array of Object in Java: a complete example program with source code and sample output, explained step by step.basic programsMultiple Inheritance using Interface Example in JavaA Java example program demonstrating Multiple Inheritance using Interface, complete with the source code and expected sample output.basic programsSingle Inheritance Example in JavaSingle inheritance enables a derived class to inherit properties and behavior from a single parent class. A Java example with source code and sample output.basic programsMultilevel Inheritance Example in JavaA Java example program demonstrating Multilevel Inheritance, complete with the source code and expected sample output.basic programsHierarchical Inheritance Example in JavaHierarchical Inheritance in Java: a complete example program with source code and sample output, explained step by step.basic programsCreate Matrix Example in JavaCreate Matrix in Java: a complete example program with source code and sample output, explained step by step.basic programsSum of Three Numbers Example in JavaA Java example program demonstrating Sum of Three Numbers, complete with the source code and expected sample output.basic programsFind All Substrings of a Given String Example in JavaA 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.basic programsHeap Sort Example in JavaHeapsort is a comparison-based sorting algorithm. A Java example with source code and sample output.basic programsTwin Prime Example in JavaA twin prime is a prime number that has a prime gap of two. A Java example with source code and sample output.inputJava Scanner Class Example in JavaLearn how to read user input in Java using the Scanner class with nextInt, nextLine and nextDouble, including a complete example and sample output.jdkJDK JRE JVM Explained Example in JavaJDK JRE JVM Explained explained in Java, with a complete example program, its sample output, and a clear code walkthrough.