Java Programs

Some of the Java Programs Topics


{tocify} $title={Table of Contents}


Simple Java Programs

  • Java Program to Check Whether a Given Number is Even or Odd
  • Java Program to Find the Sum of Even and Odd Numbers
  • Java Program to Check Whether a Number is Positive or Negative
  • Java Program to Find the Largest Number Among Three Numbers
  • Java Program to Swap Two Numbers
  • Java Program to Find the Number of Integers Divisible by 5
  • Java Program to Check if Two Numbers are Equal
  • Java Program to Find Sum of Digits of a Number
  • Java Program to Find Sum of Digits of a Number using Recursion
  • Java Program to Extract Digits from a Given Number
  • Java Program to Increment by 1 to all the Digits of a Given Integer
  • Java Program to Perform Arithmetic Operations
  • Java Program to Print Binary Equivalent of an Integer using Recursion
  • Java Program to Print Multiplication Table
  • Java Program to Read a Grade and Display the Equivalent Description
  • Java Program to Check Whether a Character is a Vowel, Consonant or Digit
  • Java Program to Check Whether a Given Alphabets are Uppercase or Lowercase or Digits
  • Java Program to Accept the Height of a Person & Categorize as Taller, Dwarf & Average

Java Programming Examples on Numbers

  • Java Program to Find Prime Numbers in a Given Range
  • Java Program to Check Prime Number
  • Java Program to Check whether a Number is Prime or Not using Recursion
  • Java Program to Check Whether a Given Number is Perfect Number
  • Java Program to Check Armstrong Number
  • Java Program to Print Armstrong Number between 1 to 1000
  • Java Program to Reverse a Number
  • Java Program to Reverse a Number and Check if it is a Palindrome
  • Java Program to Reverse a Number and Find its Sum using do-while Loop
  • Java Program to Reverse a Number using Recursion
  • Java Program to Reverse a Number without using Recursion
  • Java Program to Print First N Natural Numbers using Recursion
  • Java Program to Find Sum of Natural Numbers using Recursion
  • Java Program to Find Sum of Natural Numbers using While Loop
  • Java Program to Print 1 to 10 Numbers using For Loop
  • Java Program to Print the First n Square Numbers
  • Java Program to Find the Sum of n Square Numbers
  • Java Program to Find the Sum of n Cube Numbers

Java Programs on Date, Time & Year

  • Java Program to Check Whether a given Year is a Leap Year
  • Java Program to Extract Last Two Digits of a Given Year
  • Java Program to Convert Days into Years, Months and Days

Special Java Programs

  • Java Program without using the Main() Function
  • Java Program to Print Statement without Semicolon
  • Java Program to Print Semicolon without using Semicolon
  • Java Program to Display the ATM Transaction
  • Java Program to Get IP Address
  • Java Program to Illustrate how User Authentication is Done
  • Java Program to Shutdown Computer in Linux

Factorial & Fibonacci Programs in Java

  • Java Program to Find the Factorial of a Number using Recursion
  • Java Program to Find the Factorial of a Number Without Recursion
  • Java Program to Print Fibonacci Series
  • Java Program to Print First 100 Fibonacci Numbers
  • Java Program to Implement Efficient O(log n) Fibonacci Generator

Conversion Programs in Java

  • Java Program to Convert Binary to Decimal
  • Java Program to Convert Binary to Hexadecimal
  • Java Program to Convert Binary to Octal
  • Java Program to Convert Binary to Gray Code using Recursion
  • Java Program to Convert Binary to Gray Code without Recursion
  • Java Program to Convert Octal to Binary
  • Java Program to Convert Octal to Decimal
  • Java Program to Convert Decimal to Binary, Octal and Hexadecimal
  • Java Program to Convert Decimal to Binary using Recursion
  • Java Program to Convert Hexadecimal to Binary
  • Java Program to Convert Hexadecimal to Decimal
  • Java Program to Convert Fahrenheit to Celsius

Pattern Programs in Java

  • Java Program to Print Diamond Pattern
  • Java Program to Print Floyd’s Triangle
  • Java Program to Print Pascal Triangle
  • Java Program to Print Star Pattern
  • Java Program to Print Pyramid Pattern
  • Java Program to Print the Multiplication Table in a Triangle Form

Java Programs on Data Types & Operators

  • Java Program to Convert Integer Values into Binary
  • Java Program to Convert Integer Values into Byte, Character, Float
  • Java Program to Convert Long Values into Byte
  • Java Binary Literals
  • Java Program to use Underscores in Numeric Literal
  • Java Program to Perform Arithmetic Operations
  • Java Program to Perform Relational Operations
  • Java Program to Illustrate Use of Various Boolean Operators
  • Java Program to Find Largest of Three Numbers using Ternary Operator
  • Java Program to Illustrate Use of Pre and Post Increment and Decrement Operators

Java Programming Examples on Math Functions

  • Java Program to Add Two Complex Numbers
  • Java Program to Find Power of a Number
  • Java Program to Implement the pow() Function
  • Java Program to Find Product of Two Numbers using Recursion
  • Java Program to Implement the sin() Function
  • Java Program to Implement the cos() Function
  • Java Program to Find the Roots of a Quadratic Equation
  • Java Program to Calculate Simple Interest

Java Programming Examples on Progression Series

  • Java Program to Find Sum of Series 1^2 + 2^2 + …. + n^2.
  • Java Program to Find Sum of the Series 1/1! + 2/2! + 3/3! + ……1/N!
  • Java Program to Find Sum of the Series 1/1!+1/2!+1/3!+…1/N!
  • Java Program to Find Sum of the Series 1/1+1/4+1/9+…1/N^2
  • Java Program to Add the nth Square Series
  • Java Program to Generate Harmonic Series

Java Programming Examples on Area and Volume

  • Java Program to Find the Area of a Circle
  • Java Program to Find the Area of a Triangle
  • Java Program to Find the Area of Parallelogram
  • Java Program to Find the Area of Rhombus
  • Java Program to Find the Area of Trapezium
  • Java Program to Find Volume and Surface Area of Cone
  • Java Program to Find Volume and Surface Area of Cuboids
  • Java Program to Find Volume and Surface Area of Sphere
  • Java Program to Find the Perimeter of a Circle, Rectangle and Triangle
  • Java Program to Find the Area and Perimeter of Rectangle using Class

Java Programs on GCD, LCM & HCF

  • Java Program to Find GCD
  • Java Program to Find GCD and LCM of Two Numbers
  • Java Program to Implement Euclid GCD Algorithm
  • Java Program to Find GCD of Two Numbers using Recursion
  • Java Program to Find GCD of Two Numbers without Recursion

Java Programming Examples on Array

  • Java Program to Find the Number of Elements in an Array
  • Java Program to Find Largest Element in an Array
  • Java Program to Find Second Largest and Smallest Elements in an Array
  • Java Program to Find Local Maxima in an Array
  • Java Program to Remove Duplicate Elements from Array
  • Java Program to Merge Two Arrays
  • Java Program to Find Sum and Average of All Elements in an Array
  • Java Program to Search Key Elements in an Array
  • Java Program to Count the Number of Occurrence of an Element in an Array
  • Java Program to Find Union and Intersection of Two Arrays

More Java Programs on Array


Java Programming Examples on Matrix

  • Java Program to Multiply Two Matrices
  • Java Program to Display Lower Triangular Matrix
  • Java Program to Display Upper Triangular Matrix
  • Java Program to Find the Sum and Product of Elements in a Row/Column
  • Java Program to Find Transpose of a Matrix
  • Java Program to Find the Determinant of a Matrix
  • Java Program to Find Inverse of a Matrix
  • Java Program to Check if a Matrix is a Sparse Matrix

More Java Programs on Matrix


Java Programs on Bitwise Operation

  • Java Program to Perform Bitwise Operations
  • Java Program to Perform Addition Operation using Bitwise Operators
  • Java Program to Multiply Number by 4 using Bitwise Operators
  • Java Program to Check if Bit Position is Set to One or not
  • Java Program to Convert Decimal to Binary and Count the Number of 1s
  • Java Program to Swap Two Numbers using Bitwise XOR Operation
  • Java Program to Count Set Bits using Bitwise Operations
  • Java Programs on Strings
  • Java Program to Concatenate Two Strings
  • Java Program to Remove All Adjacent Duplicates from String
  • Java Program to Reverse Each Word in a String
  • Java Program to Find the Largest and Smallest Word in a String
  • Java Program to Find the First non-repeated Character in a String
  • Java Program to Count the Number of Unique Words
  • Java Program to Check if a Given String is Palindrome

More Java Programs on Strings


Java Programming Examples on Classes

  • Java Program to Illustrate Use of Constructor
  • Java Program to Illustrates Use of Chaining Constructor
  • Java Program to Illustrate Use of Final Keyword
  • Java Program to Illustrate the Use of HashCode() Method
  • Java Program to Create a Method without Parameters and with Return Type
  • Java Program to Check Whether Which One is Executed First, Static Block or the Static Method

More Java Programs on Classes


Java Programs on Object & Method

  • Java Program to Count Number of Objects Created for Class
  • Java Program to Implement the Passing and Returning Objects
  • Java Program to Show the Nesting of Methods
  • Java Program to Calculate Sum of Two Byte Values using Type Casting
  • Java Program to Find Area of Square, Rectangle and Circle using Method Overloading

More Java Programming Examples on Objects & Methods


Java Programs on Inheritance

  • Java Program to Use This Keyword in Inheritance Class
  • Java Program to Use Super Keyword in Inheritance Class
  • Java Program to Display Method Overriding in a Class using Inheritance Class
  • Java Program to Access Super Class in a Method Overriding
  • Java Program that Show the Implementation of Interface
  • Java Programs on Exception & String Handling
  • Java Program to Handle the Exception Using Try and Multiple Catch Block
  • Java Program to Handle the User Defined Exception using Throw Keyword
  • Java Program to Illustrate Use of getChar() and split() Method
  • Java Program to Illustrate Use of Split() String Method
  • Java Program to Create and Use String Class Methods
  • Java Programs on Event Handling
  • Java Program to Close the Frame using WindowAdapter Class
  • Java Program to Draw a Line using GUI
  • Java Program to Draw a Smiling Face using Graphics Class Methods
  • Java Program to Display Several Dots on the Screen Continuously
  • Java Program to Create a Color Dialog Box to Change the Background Color of Frame
  • Java Program to Display a Message in a New Frame
  • Java Program to Display Text in the Frame by using DrawString and Inheriting JPanel Class
  • Java Program to Create Text Area and Password Field
  • Java Program to Get and Set State and Get Label of a Check Box
  • Java Program to Create a Menu and Menu Bar

More Java Programs on Event Handling


Java Programs on Collections

  • Java Program to Implement ArrayBlockingQueue API
  • Java Program to Implement ArrayList API
  • Java Program to Implement ConcurrentHashMap API
  • Java Program to Implement ConcurrentLinkedQueue API
  • Java Program to Implement EnumMap API
  • Java Program to Implement HashTable API
  • Java Program to Implement LinkedBlockingQueue API
  • Java Program to Implement LinkedList API
  • Java Program to Implement PriorityBlockingQueue API
  • Java Program to Implement WeakHashMap API

More Java Programs on Collection API


Java Programs on Applet

  • Java Program to Create a Basic Applet
  • Java Program to Display a Pie Chart using Frame
  • Java Program to Create a Transparent Cursor
  • Java Program to Show the use of Methods of Vector Class
  • Java Program to Show the use of Various Methods of URL Class
  • Java Program to Check Whether Antialiasing is Enabled or Not

More Java Programming Examples on Applet


Java Programming Examples on Sorting

  • Java Program to Implement Selection Sort
  • Java Program to Implement Bubble Sort
  • Java Program to Implement Stooge Sort Algorithm

More Java Programs on Sorting

Post a Comment