Java Programs
New: 50 Java Programs for Beginners with Output — all of these in one page.
Java programs with output, organized by topic — the coding questions asked in interviews and written tests. Updated September 2026.
Arrays
- Find the Missing Number in an Array
- Find the Second Largest Number in an Array
- Print Repeated Numbers in an Array
- Find Duplicate Elements in an Array
- Find Common Elements Between Two Arrays
Strings
- Reverse a String
- Check Whether a String is a Palindrome
- Print Vowels in a String
- Check Whether a String Has All Unique Characters
- Remove Duplicate Characters from a String in O(n)
- Check Balanced Parentheses in O(n)
Numbers and basics
- Check Even or Odd Number
- Add Two Numbers
- Find the Sum of Digits
- Convert Decimal to Binary
- Convert Binary to Decimal
- Print Prime Numbers
- Find the Factorial of a Number
- Find the Area of a Circle
Collections and OOP
- Create Your Own ArrayList
- Program Using the Comparable Interface
- Program Using the Comparator Interface
Preparing for interviews? Start with the Java Interview Prep hub.
Comments
Post a Comment