Behold my collection of Java code that got me through countless assignments and projects!
Each snippet has survived the trial by fire of tight deadlines and midnight debugging sessions. Not claiming they're revolutionary, but they've earned their place in this vault.
Addition
, Calculator
, Minmax
, Number of Even and Odd numbers
, Summation
, Total and highest marks
Everything you need for handling numbers and basic calculations. From simple addition to finding max values and summing arrays.
Area Constructor Overload
, Area Method Overloading
, Employee Data Storing
, Inheritance
, Highest Wage
These demonstrate core OOP concepts with real examples - from method overloading to inheritance hierarchies that actually make sense.
Tables
, Sum of diagonal elements
, Transpose of Matrix
, Palindrome
Matrix operations and data validations that will save you hours of frustration.
In-built Exceptions
, User-defined Exception
, Payment Exception (User-defined)
Custom exception classes and handling techniques that make your programs robust.
Eligibility
, Password validity
Input validation logic that helps build safer applications.
Multithreading (by implementing Runnable)
, Multithreading (using thread class)
Two approaches to multithreading with clear examples of when to use each one.
Registration Form (GUI based)
Swing-based interface example with proper event handling.
These solutions were written at a college level - they solve specific problems but aren't necessarily optimized for performance or scalability. They worked for my assignments, but real-world applications might need more robustness!
Compile a Java file:
javac FileName.java
Run a Java program:
java FileName
Spotted something that could be improved or doesn't work?
- Fork, fix, and send a pull request
- Use the issues tab to report bugs
- Solve it yourself and learn from the process
May your compiles be error-free and your runtime exceptions few! π