Java programs examples pdf – Java Programs | Java Programming Examples with Output | 1000+ List of Simple Java Programming Interview Questions

Java programs examples pdf: Exploring java programs from basic to advanced can be done via this ultimate BTech Geeks Java Programming Examples tutorial. An excellent way to learn this most effective java programming language is by practicing all these java programs. The following core java programs for beginners & experienced developers are tested and provided with output for better learnings and practice. Java Programmers who wish to upskill their programming skills should start practicing the best java programs. Here’s the new collection list of basic java programs for beginners and experienced java programmers.

Not only the java programs examples but also the article provides the following information for more exploration about the java program. They are:

  • Java Basic Programs
  • Java Basic Programs Pdf
  • Java Programs Pdf
  • All Java Programs Pdf
  • Core Java Programs Pdf
  • Java Code Examples Pdf
  • Java Solved Programs Pdf
  • Java Example Programs Pdf
  • Java Programming Examples Pdf
  • Java Programs For Practice Pdf
  • Simple Java Programs For Beginners Pdf
  • Basic Java Programs For Beginners Pdf
  • Top 100 Java Programs Pdf
  • 100 Java Programs With Output Pdf
  • Java Programs Examples With Output
  • Java Programs Examples With Output Pdf
  • 1000 Java Programs Pdf
  • 1000 Java Programs
  • Java 1000 Programs
  • 1000 Java Programs Pdf Free Downloands.

List of 1000+ Simple Java Programming Examples for Beginners

Java Basic Programs for Beginners | Basic Core Java Programs for Interview

Java Decision Making and Loop Programming Examples

Java Star Pattern Programs

Java Number Pattern Programs

Java Character pattern Programs

Java Type Conversion Programs

Java Geometrical Calculation Program

Java Number Conversion Programs

Java Number Programs

Java Matrix Programs

Java Array Programs

Java ArrayList Programs

Java Vector Programs

Java Singly Linked List Programs

Java LinkedList Programs

Java Functions Programs

  • Java Program to Display Prime Numbers Between Intervals Using Function
  • Java Program to Display Armstrong Numbers Between Intervals Using Function
  • Java Program to Check Whether a Number can be Expressed as Sum of Two Prime Numbers
  • Java Program to Convert Binary Number to Decimal and vice-versa
  • Java Program to Convert Octal Number to Decimal and vice-versa
  • Java Program to Convert Binary Number to Octal and vice-versa
  • Java Program to Call One Constructor from another
  • Java Program to implement private constructors
  • Java Program to pass lambda expression as a method argument
  • Java Program to pass method call as arguments to another method
  • Java Program to Calculate the Execution Time of Methods

Java Data Types With Examples

  • Data Types in Java
  • Java boolean Data Type with Example
  • Java char Data Type with Example
  • Java byte Data Type with Example
  • Java short Data Type with Example
  • Java int Data Type with Example
  • Java long Data Type with Example
  • Java float Data Type with Example
  • Java double Data Type with Example
  • Java Non Premitive Data Type with Example

Java Operators With Examples

Java Class and Object Programs | Object and Class Java Programming Examples

  • Java Program to Calculate Difference Between Two Time Periods
  • Java Program to Determine the class of an object
  • Java Program to Create an enum class
  • Java Program to Print object of a class
  • Java Program to Create custom exception
  • Java Program to Create an Immutable Class
  • Java Program to Create a Class and Object
  • Java Program to Create Abstract Class
  • Java Program to Create Singleton Class
  • Java Program to Create an Interface
  • Java Program to Sow Encapsulation in Class
  • Java Program to Show Inheritance in Class
  • Java Program to Show Abstraction in Class
  • Java Program to Show Data Hiding in Class
  • Java Program to Show Polymorphism in Class
  • Java Program to Show Overloading of Methods in Class
  • Java Program to Show Overriding of Methods in Classes
  • Java Program to Show Use of Super Keyword in Class
  • Java Program to Show Use of This Keyword in Class
  • Java Program to Show Usage of Static keyword in Class
  • Java Program to Show Usage of Access Modifier

Java Character Programs

Java String Programs

Java Network Programs

Java Miscellaneous Programs

Java Collections Programs

  • Java Program to Join Two Lists
  • Java Program to Convert the ArrayList to an array and vice versa
  • Java Program to Convert Map (HashMap) to List
  • Java Program to Convert Array to Set (HashSet) and Vice-Versa
  • Java Program to Sort a Map By Values
  • Java Program to Sort ArrayList of Custom Objects By Property
  • Java Program to Implement LinkedList
  • Java Program to Implement stack data structure
  • Java Program to Implement the queue data structure
  • Java Program to Get the middle element of LinkedList in a single iteration
  • Java Program to Convert the LinkedList into an Array and vice versa
  • Java Program to Convert the ArrayList into a string and vice versa
  • Java Program to Iterate over an ArrayList
  • Java Program to Iterate over a HashMap
  • Java Program to Iterate over a Set
  • Java Program to Merge two lists
  • Java Program to Update value of HashMap using key
  • Java Program to Remove duplicate elements from ArrayList
  • Java Program to Get key from HashMap using the value
  • Java Program to Detect loop in a LinkedList
  • Java Program to Calculate union of two sets
  • Java Program to Calculate the intersection of two sets
  • Java Program to Calculate the difference between two sets
  • Java Program to Check if a set is the subset of another set
  • Java Program to Sort map by keys
  • Java Program to Pass ArrayList as the function argument
  • Java Program to Iterate over ArrayList using Lambda Expression
  • Java Program to Implement Binary Tree Data Structure
  • Java Program to Perform the preorder tree traversal
  • Java Program to Perform the postorder tree traversal
  • Java Program to Perform the inorder tree traversal
  • Java Program to Count number of leaf nodes in a tree
  • Java Program to Implement the graph data structure
  • Java Program to Remove elements from the LinkedList.
  • Java Program to Add elements to a LinkedList
  • Java Program to Access elements from a LinkedList.
  • Java Program to Use Different Types of a Collection
  • Java Program to Print a Collection
  • Java Program to Get the Size of the Collection
  • Java Program to Compare Elements in a Collection
  • Java Program to Shuffle the Elements of a Collection
  • Java Program to Reverse a Collection
  • Java Program to Convert Collection into Array
  • Java Program to Convert Array into Collection
  • Java Program to Replace Elements in a List
  • Java Program to Rotate Elements of a List
  • Java Program to Iterate through Elements of HashMap

Java Algorithms Programs

  • Java Program to Implement Bubble Sort algorithm
  • Java Program to Implement Quick Sort Algorithm
  • Java Program to Implement Merge Sort Algorithm
  • Java Program to Implement Binary Search Algorithm

Java Files Programs

  • Java Program to Get the File Size
  • Java Program to Create and Write into File
  • Java Program to Create a File and Write into the File
  • Java Program to Delete a File
  • Java Program to Get Current Working Directory
  • Java Program to Create String from Contents of a File
  • Java Program to Append Text to an Existing File
  • Java Program to Convert File to byte array and Vice-Versa
  • Java Program to Create Directories
  • Java Program to Rename File
  • Java Program to Get all Files Present in a Directory
  • Java Program to Copy File
  • Java Program to Create File and Write to the File
  • Java Program to Read the Content of a File Line by Line
  • Java Program to Delete File in Java
  • Java Program to Delete Empty and Non-empty Directory
  • Java Program to Get the File Extension
  • Java Program to Get the name of the file from the absolute path
  • Java Program to Get the relative path from two absolute paths
  • Java Program to Count Number of lines present in the file
  • Java Program to Create a temporary file
  • Java Program to Make a File Read-Only
  • Java Program to Compare Paths of Two files
  • Java Program to Copy one file into another file
  • Java Program to Print all the Pattern that Matches Given Pattern From a File
  • Java Program to Append a String in an Existing File
  • Java Program to Read content from one file and writing it into another file
  • Java Program to Read and printing all files from a zip file

Java I/O Stream Programs

  • Java Program to Convert InputStream to String
  • Java Program to Convert OutputStream to String
  • Java Program to Convert a String into the InputStream
  • Java Program to Convert the InputStream into Byte Array
  • Java Program to Load File as InputStream

Java Method Programs

  • Java Program to Show Usage of Main() method
  • Java Program to Show Use of Static and Non-static Methods
  • Java Program to Show Usage of forEach() Method
  • Java Program to Show Usage of toString() Method
  • Java Program to Show Usage of codePointAt() Method
  • Java Program to Show Usage of compare() Method
  • Java Program to Show Usage of equals() Method
  • Java Program to Show Usage of hasNext() and next() Method
  • Thread Lifecycle Methods
    • start() Method
    • run() Method

Java Searching Programs

  • Java Program to Search an Element in an Array using Linear Search
  • Java Program For Linear Search
  • Java Program For Binary Search
  • Java Program to Recursively Linearly Search an Element in an Array

Java List Programs

  • Java Program to Initializing a List
  • Java Program to Find a Sublist in a List
  • Java Program to Get Minimum and Maximum From a List
  • Java Program to Split a list into Two Halves
  • Java Program to Remove a Sublist from a List
  • Java Program to Remove Duplicates from an Array List
  • Java Program to Remove Null from a List container
  • Java Program to Sort Array list in an Ascending Order
  • Java Program to Get First and Last Elements from an Array List
  • Java Program to Convert a List of String to Comma Separated String
  • Java Program to Add Element at First and Last Position of a Linked list
  • Java Program to Find Common Elements in Two ArrayList
  • Java Program to Remove Repeated Element From An ArrayList

Java Date and Time Programs

LocalDate Class Programs:

Java Directory Programs

  • Java Program to Traverse in a directory
  • Java Program to Get the size of a directory
  • Java Program to Delete a directory
  • Java Program to Create directories recursively
  • Java Program to Search for a file in a directory
  • Java Program to Find the current working directory
  • Java Program to Display all the directories in a directory

Java Exceptions and Errors Programs

  • Java Program to Show Runtime exceptions
  • Java Program to Show Types of errors
  • Java Program to Handle the Exception Hierarchies
  • Java Program to Handle the Exception Methods
  • Java program to Handle the Checked exceptions
  • Java Program to Handle the Unchecked Exceptions
  • Java Program to Handle Divide By Zero and Multiple Exceptions
  • Java Program to Show Unreachable Code Error
  • Java Program to Show Thread interface and memory consistency errors

Java Multithreading Programs

  • Java Program to Check the Thread Status
  • Java Program to Suspend a Thread
  • Java Program to Join Threads
  • Java Program to Show Daemon Thread

Java Examples on Mathematical Calculations

Java Unit Conversion Program

LENGTH:

AREA:

TEMPERATURE

TIME

WEIGHT

VOLUME

  • Java Program to Convert Milliliter to Liter and Vice versa
  • Java Program to Convert Cubic Meter to Cubic Centimeter and Cubic Centimeter to Cubic Meter
  • Java Program to Convert Cubic Mile to Cubic Kilometer and Cubic Kilometer to Cubic Mile
  • Java Program to Convert Cubic Foot to Cubic Inch and Cubic Inch to Cubic Foot
  • Java Program to Convert Cubic Yard to Cubic Foot and Cubic Foot to Cubic Yard

SPEED

DATA

ENERGY

POWER

Java Algebraic Formula Program

Java Series Program

Java Simple Programs on Special Numbers

  • Java Program to Print Armstrong Number from 1 to 1000
  • Java Program to Check if a Given Number is Perfect Number
  • Java Program to Check If a Given Number is Armstrong Number
  • Java Program to Check if a Given Number is Prime Number
  • Java Program to Find Sum of Natural Numbers Using While Loop
  • Java Program to Calculate the Sum, Multiplication, Division and Subtraction of Two Numbers
  • Java Program to Print the Next 20 Leap Years
  • Java Program to Print the First Twenty Perfect Squares
  • Java Program to Input a String with at least One Number, Print the Square of all the Numbers in a String

Java Programming Examples on Fibonacci and Complex Numbers

  • Java Program to Display Fibonacci Series
  • Java Program to Print Fibonacci Series in Different Ways
  • Java Program to Generate Fibonacci Numbers
  • Java Program to Compute List of First 100 Fibonacci Numbers
  • Java Program to Add two Complex Numbers
  • Java Program to Add Two Complex Numbers by Passing Class to a Function

Java Examples on Recursion

Java Data Types Programming Examples

  • Java Program to Check Whether an Alphabet is Vowel or Consonant
  • Java Program to Check if given Alphabets are Uppercase or Lowercase or Digits
  • Java Program to Illustrate Use of Binary Literals
  • Java Program to Use Underscores in Numeric Literal
  • Java Program to Illustrate the Usage of Decimal Integer, Octal Integer, HexaDecimal, Floating, Character Literals
  • Java Program to Store Escape Sequence and Unicode Characters Using Character Literals
  • Java Program to Perform Binary Addition of Strings

Java Special Programs with Outputs

  • Java Program to Print a Semicolon without Using a Semicolon Anywhere in the Code
  • Java Program to Print any Statement without Using Semicolon
  • Java Program to Accept the Height of a Person & Categorize as Taller, Dwarf & Average
  • Java Program to Generate a DOT Representation of a Graph
  • Java Program to Automatically Generate Essays for You

Java Examples on Delegation Event Model

  • Java Program to Handle MouseEvent
  • Java Program to Handle KeyBoardEvent

Java Program on Handling Check Boxes

  • Java Program to Get and Set State and Get Label of a Check Box

Java Programming Examples on Handling a TextField

  • Java Program to Create 2 Labels and Text Fields for Entering Name and Secured Password
  • Java Program to Display Text in the Frame by Overriding PaintComponent() Method of JPanel Class
  • Java Program to Display Some Text in the Frame with the Help of a Label
  • Java Program to Create a Text Area and Display the Mouse Event When the Button on the Mouse is Clicked, When the Mouse is Moved etc is Done by the User
  • Java Program to Create Some Text Fields and Text Areas to Demonstrate Features
  • Java Program to Trap the Key Code and Key Name Typed by the User on the KeyBoard and Display them in a Text Area
  • Java Program to Trap a Key Which is Pressed on the KeyBoard and Display its Name in the Text Area. In this Program, We Consider Some Keys Only for Demonstration Purpose

Java Programs on Menu Bars and Menus

  • Java Program to Create a Menu with Several Menu Items
  • Java Program to Create a Menu and Handle the File Open Event for the User
  • Java Program to Perform Menu Driven Arithmetic Operations Using Switch Case
  • Java Program to Create a Choice Menu to Select an Item and Display it in the Frame

Java Example Programs on Applet Class

  • Java Program to Create a Basic Applet
  • Java Program to Create a Banner Using Applet
  • Java Program to Display Clock Using Applet
  • Java Program to Create and Fill Shapes using Applet
  • Java Program to Goto a Link using Applet
  • Java Program to Create an Event Listener in Applet
  • Java Program to Display Image Using Applet
  • Java Program to Open a Link in a New window using Applet
  • Java Program to Play Sound Using Applet
  • Java Program to Perform Read and Write Operations for a File using Applet
  • Java Program to Use Swing Applet in JAVA
  • Java Program to Demonstrate a Basic Calculator using Applet
  • Java Program to Display Human Face using Applet
  • Java Program to Load and Display an Image Using Applet
  • Java Program to Find Square of a Given Number Using Applet
  • Java Program to Change the Background Colour of Applet by Clicking on Control Button

Advanced Java Programs with Output

  • Java Program to Get Current Date/TIme
  • Java Program to Convert Milliseconds to Minutes and Seconds
  • Java Program to Add Two Dates
  • Java Program to Convert Byte Array to Hexadecimal
  • Java Program to Lookup enum by String value
  • Java Program to Calculate simple interest and compound interest
  • Java Program to Implement multiple inheritance
  • Java Program to Determine the name and version of the operating system
  • Java Program to Check if two of three boolean variables are true
  • Java Program to Iterate over enum
  • Java Program to Check the birthday and print Happy Birthday message
  • Java Program to Access private members of a class

More Java Programs

  • Java Program to Convert Linked list to an Array
  • Java Program to Convert Vector to a List
  • Java Program to Convert String to a List of Characters
  • Java Program to Convert Iterator to a List
  • Java Program to Convert List to a Map
  • Java Program to Convert List to a Stream
  • Java Program to Convert List to Set
  • Java Program to Convert Set of String to Array of String
  • Java Program to Convert String to Object
  • Java Program to Convert string value to byte value

10 Simple Java Example Programs for Beginners & Experienced Programmers

The following 10 simple java programming examples help beginners and expert programmers learn and practice the short logic of the program for quick usage and upskill your knowledge. Let’s check these basic yet most commonly asked java programs in interviews:

1. ‘Hello World’ Java Program:

One of the most important programs to learn by all developers is an introduction program to java by printing “Hello World” words. Also, check more details about Hello Word Program using Java from here.

Java Program to Print Hello World

2. Prime Number Program in Java:

Out of this plenty of basic java programs list, the most commonly asked programming example in interviews or examinations is Prime Number Java Program. Here is the simple & one-line code for the prime number program. Want to learn more variations about Java Program to Check if a Given Number is Prime Number? Make use of the link provided here.

Prime Number Program in Java

3. Fibonacci Series in Java:

By using the following simple code, you can easily grasp the logic behind the Fibonacci series. If you really excited to learn the various methods like using recursion and without recursion check out this Java Program to Display Fibonacci Series

Fibonacci Series Program in Java

4. Factorial Using Java:

Here, we have given a simple code for a factorial java programming example. If you want to explore more about it then go for this Java Program to Find Factorial of a Number

Java Program for Finding Factorial of a Number

5. Decimal to Binary Conversion in Java:

Check out this shortcode to convert the decimal from binary and practice it regularly for quick usage in the required time of programming. In case, are you a newbie to java conversion programming examples? then view this Java Program for Decimal to Binary Conversion.

Java Program for Decimal to Binary Conversion

6. Matrix Transpose Java Code:

Are you searching for the one-line code to find the transpose of a matrix? then look at the below code. If you need to learn the same program in a detailed manner then click on this Java Program to Find a Transpose of a Matrix.

Java Program to Find Transpose of a Matrix

7. Armstrong Number in Java:

Need a simple program to check whether the given number is Armstrong or not? then make use of the following code for quick reference. For perfect programming in java, practicing the basic Java Program on Check Armstrong Number.

Java Program to Check Armstrong Number

8. Palindrome Number using Java:

This simple line of code is helpful for checking the given number is palindrome or not. If required to learn more about the logic behind it then tap on this Java Program to Check Palindrome.

Java Program to Check Palindrome String

Java Program to Check Palindrome Number

9. String Comparison in Java:

The code for the Java program to compare strings is prevailing here in a short form. If you want to practice more logic on string comparison like Java Program to compare two strings check out the given link.

Java Program to Compare Strings

10. Sorting an Array Using Java:

The best and effective way to understand the array sorting logic is by practicing with the given code. Also, you can check out the different methods by using this link ie., Java Program to Sort an Array.

Java Program to Sort an Array in Ascending Order

Final Words

Hoping that our collection of basic and simple java programs for beginners and experienced programmers helped everyone a lot in learning the java programming language faster. If want to suggest more core java programming examples with output from basic to advanced level, then reach out to us by commenting below and our expert developers will look into them. Click the Ctrl+D shortcut and bookmark our website BTechgeeks.com for getting assistance on any programming languages like C++, Python, etc.