This repository contains a comprehensive collection of Java programming exercises and assignments demonstrating various concepts from basic programming fundamentals to advanced object-oriented programming (OOP) concepts. The files are organized to showcase my learning journey in Java development.
Basic Java programs demonstrating fundamental concepts:
Hello.java
/InputExample.java
- Basic input/output operationsCalculator.java
- Simple calculator with basic arithmetic operationsTemperature.java
- Temperature conversion (Celsius β Fahrenheit)Table.java
- Multiplication table generatorSumOfNatural.java
- Sum of first N natural numbersFactorial.java
- Factorial calculationMarks.java
- Grade calculation based on marks in DSA, OOP, and DBMSCounter.java
- Even/odd number counterPassword.java
- Simple password guessing gameGuessTheGame.java
- Number guessing game with random number generation
SimpleInterestCalculator.java
- Multi-customer simple interest calculatorBusTicket.java
- Bus ticket booking system simulationAtm.java
- Basic ATM withdrawal simulationBill.java
- Electricity bill calculator with tiered pricing
Animal.java
- Basic class definition with constructor and methodsAnimalDemo.java
- Inheritance and polymorphism with Animal, Dog, and Cat classesShape.java
- Basic shape class with method definitionsGeeks.java
- Abstract classes and method overriding with geometric shapesPerson.java
- Base Person class for inheritance examplesSingleInheritanceDemo.java
- Student extends Person class demonstrationLibraryDemo.java
- Advanced inheritance with LibraryItem, Book, and Magazine classesBank.java
- Basic banking class structure
Structured assignments demonstrating specific programming concepts:
Account.java
- Complete banking account class with deposit, withdrawal, and contact managementUserInterface.java
- Console-based banking application with menu system
Folder 1: Library Management System
Book.java
- Book class with encapsulationLibrary.java
- Library management with ArrayList operationsMain.java
- Demonstration of library operationsREADME.md
- Detailed documentation
Folder 2: Student Management System
Student.java
- Student class with grades and GPA calculationCourse.java
- Course enrollment and managementMain.java
- Combined student and course management demo
Folder 3: Employee Management System
Employee.java
- Base employee classManager.java
- Manager class extending Employee with bonusDeveloper.java
- Developer class extending Employee with overtime payDepartment.java
- Department management with salary calculations
staticArray.cpp
- C++ example for comparison (dynamic vs static arrays)
- Variables, data types, and operators
- Control structures (if-else, loops, switch)
- Scanner for user input
- Random number generation
- Mathematical calculations
- Classes and Objects: Creating and using custom classes
- Encapsulation: Private variables with public getter/setter methods
- Inheritance: Single and multilevel inheritance examples
- Polymorphism: Method overriding and dynamic method dispatch
- Abstraction: Abstract classes and methods
- Constructors: Default and parameterized constructors
- Arrays and ArrayList operations
- HashMap for key-value storage
- Collection iteration and manipulation
- Proper class design and separation of concerns
- User interface separation from business logic
- Input validation and error handling
- Code documentation and commenting
- Java Development Kit (JDK) 8 or higher
- Terminal/Command prompt access
-
Single File Programs:
javac ProgramName.java java ProgramName
-
Multi-Class Programs:
javac *.java java MainClassName
-
Assignment Folders:
cd assignment/ javac *.java java UserInterface
# Run the calculator
javac Calculator.java
java Calculator
# Run the banking system
cd assignment/
javac *.java
java UserInterface
# Run the library management system
cd assignment2/1/
javac *.java
java Main
Enter the value 1: 10
Enter the value 2: 5
Enter the operator: +
Result: 15
Welcome to the Banking Application!
1. Create a new account
2. Deposit money
3. Withdraw money
4. View account details
5. Update contact details
6. Exit
Enter your choice: 1
Enter account holder name: John Doe
Enter initial deposit amount: 1000.0
Enter email address: john@example.com
Enter phone number: 123-456-7890
Account created successfully with Account Number: 1001
Enter the marks of Subject DSA: 85
Enter the marks of Subject OOP: 90
Enter the marks of Subject DBMS: 88
Grade: A
Through these exercises, I have practiced and demonstrated:
- Problem Solving: Breaking down complex problems into manageable components
- Code Organization: Structuring code for readability and maintainability
- User Experience: Creating intuitive console-based applications
- Error Handling: Implementing proper input validation and error management
- Documentation: Writing clear, comprehensive documentation
- Language: Java (JDK 8+)
- IDE/Editor: VS Code
- Version Control: Git
- Documentation: Markdown
A complete console-based banking system featuring:
- Account creation and management
- Deposit and withdrawal operations
- Contact information updates
- Data validation and error handling
Object-oriented library system demonstrating:
- Book and Library class design
- ArrayList operations
- Encapsulation principles
- Clean code practices
Inheritance-based system showcasing:
- Base Employee class with Manager and Developer extensions
- Polymorphic salary calculations
- Department-level aggregation and reporting
- Add GUI interfaces using Swing or JavaFX
- Implement file I/O operations for data persistence
- Add unit testing with JUnit
- Integrate database connectivity with JDBC
- Implement more advanced design patterns
- Add exception handling mechanisms
- Create web-based interfaces using Spring Boot
- Total Java Files: 40+
- Lines of Code: 2000+
- Concepts Covered: 15+
- Assignment Folders: 3
- Documentation Files: 2
Varun Chauhan
Java Programming Practice Repository
Demonstrating fundamental to advanced Java concepts
This repository represents my continuous learning journey in Java programming, from basic syntax to advanced object-oriented design principles. Each program is designed to reinforce specific concepts and build upon previous knowledge.