A collection of Java programs I wrote while learning the fundamentals of Java programming. This repo covers everything from basic syntax to object-oriented programming concepts.
- Basics — variables, data types, operators, input/output
- Control Flow — if-else, switch, ternary operator
- Loops — for, while, do-while, nested loops
- Arrays — 1D arrays, 2D arrays, array operations
- Strings — string methods, manipulation, palindrome, reverse
- Methods — user-defined methods, recursion
- OOP Concepts — classes, objects, constructors, inheritance, polymorphism, encapsulation, abstraction
- Exception Handling — try-catch, finally
- Collections — ArrayList, HashMap (basics)
1. Clone the repo
git clone https://github.com/aasthanandekar/basic-java.git
cd basic-java2. Compile any file
javac HelloWorld.java3. Run it
java HelloWorld- How Java is structured — classes, main method, and compilation
- Difference between primitive and reference data types
- Writing clean loops and conditions
- Core OOP concepts — inheritance, polymorphism, encapsulation
- How exceptions work and how to handle errors gracefully
- Thinking in an object-oriented way