Skip to content

A collection of beginner-friendly Java programs covering operators, loops, arrays, strings, numbers, recursion, and patterns.

Notifications You must be signed in to change notification settings

KanugantiHaripriya/BasicJavaProgramming_PEntagon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Java Programs

📌 Overview

This repository contains a wide collection of basic Java programs, organized by topics/packages.
It is designed to help beginners understand core Java concepts, improve problem-solving skills, and practice coding.


📂 Project Structure with Key Logics

🔹 Operators

  • ArithmeticOperators – Perform + , - , * , / , %.
  • AssignmentOperators – Example: a += b means a = a + b.
  • LogicalOperators – Use && (AND), || (OR), ! (NOT).
  • RelationalOperators – Example: a > b, a == b.
  • TernaryOperator – Syntax: condition ? value1 : value2.
  • UnaryOperators – Example: ++a , a++ , --a , -a.

🔹 Patterns

  • Example1 – Example7

🔹 Array

  • AddElement
  • Check_array
  • Maxnum
  • Practice
  • RemoveElement
  • Reverse
  • RotateAnticlock
  • RotateClockwise

🔹 IfElse

  • Marks → marks >= 35 → Pass else Fail

🔹 Loops

  • DoWhile
  • ForLoop
  • WhileLoop

🔹 Numbers

  • Armstrong → sum(d^n) == num (153 = 1³+5³+3³)
  • DigitsCount → while(n>0) n/10
  • Emirp → Prime and reverse is also prime
  • Factor → Numbers that divide n exactly
  • HappyNumber → Replace number by sum of squares of digits until 1
  • Hcf → Greatest number dividing both a & b
  • KrishnaMurthyNumber → sum(fact(digits)) == num
  • Lcm → Smallest number divisible by both a & b
  • Palindrome → reverse == original
  • Perfect → sum(factors) == num
  • PositiveInteger → n > 0
  • Prime → Divisible only by 1 and itself
  • PrimeMethod
  • SpyNumber → sum(digits) == product(digits)

🔹 Strings

  • ASCII
  • Anagram → Same characters in any order
  • ConvertArray
  • First
  • Problem1 – Problem6
  • ReverseSubstring
  • Substring
  • VowConso → Count vowels & consonants
  • palindrome → reverse == original

🔹 Recursion

  • ArmstrongRec
  • Factorial → n! = n × (n-1)!
  • ReverseRecur
  • Test

🔹 SearchingTechniques

  • BinarySearch → Divide & search mid element
  • LinearSearch → Check one by one

🔹 SortingTechniques

  • BubbleSort → Swap adjacent elements until sorted

🔹 Switch

  • Days

🔹 TwoDArray

  • Practice

Project Structure

├── .settings/
├── bin/
├── src/
│ ├── Array/
│ ├── IfElse/
│ ├── Loops/
│ ├── Numbers/
│ ├── Operators/
│ ├── Patterns/
│ ├── Recursion/
│ ├── SearchingTechniques/
│ ├── SortingTechniques/
│ ├── Strings/
│ ├── Switch/
│ ├── TwoDArray/
│ └── module-info.java
├── .classpath
└── .project

About

A collection of beginner-friendly Java programs covering operators, loops, arrays, strings, numbers, recursion, and patterns.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages