Welcome to my collection of Java programming practice files. These files demonstrate various Java programming concepts and techniques that I've learned throughout my coursework. Each file is a standalone program that focuses on a specific topic or problem.
This repository contains practice Java programs that I developed during my college coursework. The files cover a wide range of Java programming topics such as:
- Basic Syntax and Data Types
- Control Flow (loops, conditionals)
- Object-Oriented Programming (OOP)
- Inheritance and Polymorphism
- Exception Handling
- File I/O
- Collections and Generics
- Multithreading
Each file is well-documented with comments explaining the logic behind the code.
Below is a list of the key programs in this repository:
| Filename | Description |
|---|---|
HelloWorld.java |
Basic program to print "Hello, World!" |
Calculator.java |
Simple calculator performing addition, subtraction, etc. |
Factorial.java |
Program to calculate the factorial of a given number |
ArraySort.java |
Sorting an array of integers using the bubble sort |
InheritanceDemo.java |
Demonstrates inheritance and method overriding |
FileIOExample.java |
Reading from and writing to a file |
ThreadExample.java |
Example of creating and running threads in Java |
GenericExample.java |
Demonstrates the use of generics in Java |
Feel free to browse the individual files for more information on each program.
You can compile and run any of these Java programs using the javac compiler and java command. Below are the steps to compile and execute a program:
-
Compiling a Program: Open your terminal and navigate to the folder containing the Java file you want to compile. Use the following command to compile:
javac Filename.java
Example for
HelloWorld.java:javac HelloWorld.java
-
Running the Program: After compilation, you can run the program using:
java Filename
Example:
java HelloWorld
Here are some additional resources that helped me in learning Java programming:
Feel free to explore these resources to deepen your understanding of Java.
This repository is for educational purposes, but if you have suggestions or improvements, feel free to fork the repo and submit a pull request.
Thank you for visiting this repository! Happy coding! 🚀