📘 Java Programs

Practice core Java programming with small, focused problems. These programs cover numbers, strings, arrays, and pattern printing — perfect for interviews, coding rounds, and strengthening logic building.

🔢 Number Programs

📅 Check Leap Year

Determine whether a year is a leap year in Java using simple conditional logic and modular arithmetic.

🔁 Palindrome Number

Reverse the digits of a number and compare with the original to check if it is a numeric palindrome.

🔢 Prime Number

Check whether a number is prime using loops, divisibility checks, and optimized boundaries in Java.

💪 Armstrong Number

Detect Armstrong numbers by summing powered digits and comparing with the original value.

📈 Fibonacci Series

Generate Fibonacci series in Java using loops and recursion with clear step-by-step examples.

✖️ Factorial in Java

Calculate factorial of a number using iterative and recursive approaches with edge case handling.

🔤 String Programs

🔄 Palindrome String

Check if a string is a palindrome by reversing characters or using two-pointer comparison logic.

🔁 Reverse a String

Reverse strings using loops, StringBuilder, and recursion with time-complexity discussion.

🔢 String Contains Only Digits

Validate if a string has only numeric characters using regex, iteration, and built-in methods.

🔍 First Non-Repeated Character

Find the first non-repeating character in a string using maps and frequency counting.

🧮 Check Anagram Strings

Verify whether two strings are anagrams using sorting or frequency arrays/HashMap.

🔄 Longest Palindromic Substring

Find the longest palindrome substring using expand-around-center and other approaches.

📈 Character Occurrence Count

Count frequency of characters in a string using HashMap and clean output formatting.

📚 Array Programs

✅ Check if Array is Sorted

Check whether an array is sorted in ascending or descending order using simple loops.

🔍 Find Duplicates in Array

Detect duplicate elements in an array using nested loops, HashSet, and frequency maps.

🔄 Reverse Array

Reverse array elements in-place using two-pointer technique or Collections utilities.

🥈 Second Largest in Array

Find the second largest element with and without sorting, including edge case handling.

📊 Sort Array Without Built-ins

Sort arrays manually using bubble sort, selection sort, and insertion sort logic in Java.

🚫 Remove Duplicates from Array

Remove duplicate elements using Set and in-place two-pointer style techniques.

✨ Pattern Printing Programs

🔺 Pascal’s Triangle

Print Pascal’s triangle using nested loops and understand binomial coefficient logic.

🔷 Diamond Star Pattern

Display a symmetric diamond-shaped star pattern using spaces and nested loops.

🔺 Pyramid Star Pattern

Print pyramid-shaped star patterns with centered alignment and increasing rows.

📐 Right-Angled Triangle Pattern

Generate right-angled triangle star patterns using nested loops and row/column logic.

📺 Practice Java with Video Walkthroughs

Watch step-by-step explanations of Java programs, patterns, and interview-style problems.

🔔 Visit Channel & Subscribe