This repository is the collection of all the java programs that has been done in college as well as the collection of the program that were done while learning and understanding
java.
This repo has divided into three main categories and each of them have sub-categories
that covers various topics and challenges.
Feel free to contribute to this repo while following the standard contribution rules.
Contributors 👥
Instructions 📝
Compiling and Running the code
Create a new folder named bin inside of the Java-Programs folder.
Open your terminal at location where the Java-Programs is saved.
Run the following command to compile the code within a specific folder. For eg. I want to compile the code within src/college/understanding_interface folder.
javac -d bin src/college/understanding_interface/*.java
In the above command -d is a flag which means directory, specifying where to keep the compiled java programs. In this case we are specifying the bin folder.
The next part src/college/understanding_interface/*.java is the location of the java files we want to compile. *.java means include all the files with extension .java. If we wanted to compile the code within another folder we would have used different location for example src/learning/understanding_super/*.java
Open new terminal and change your directory to bin.
cd bin
Use java <pakage name>.<class name> to run the code in terminal.
For example I want to run ArrayException.java which is at location src/college/understanding_exceptions so I will use
A program that shows the implementation of Interface in java with the help of taking input from the user, the program calculates the area of Square and Rectangle.