This repository contains all the Java programs that I have executed for my Object Oriented Programming and Development with Java Course in my 2nd Year of Computer Science Undergrad program at Dayananda Sagar University, Bengaluru, India in Q1 2022.
Serial No. | C File Name | Description |
---|---|---|
1 | 1_electricityBill.java | This program calculates the electricity bill for a given number of units. |
2 | 2_moveZeros.java | This program moves all the zeros to the end of an array. |
3 | 3_nonRepeatingChar.java | This program finds the first non-repeating character in an array. |
4 | 4_salary.java | This program demonstrates the concept of inheritance in Java. |
5 | 5_methodOverloading.java | This program demonstrates the concept of method overloading in Java. |
6 | 6_garbageCollection.java | This program demonstrates the concept of garbage collection in Java. |
7 | 7_polymorphismFunction.java | This program demonstrates the concept of polymorphism in Java. |
8 | 8_exceptionHandlingFunc.java | This program demonstrates the concept of exception handling in Java. |
9 | 9_multiThreading.java | This program demonstrates the concept of multi-threading in Java. |
10 | 10_JTableP.java | This program implements a JTable in Java. |
11 | 11_buildGUI.java | This program implements a JFrame in Java. |
12 | 12_Database.java | This program implements a database and database operations in Java. |
-
Ensure that you have Java installed on your system.
java -version
It should look something like this
If you don't have Java installed, you can download it from here.
-
Clone the repository to your local machine using the following command.
gh repo clone rexgraystone/oodj
or
git clone https://github.com/rexgraystone/oodj.git
-
Navigate to the directory where you cloned the repository.
cd oodj
-
Compile the Java program using the following command.
javac <Serial Number>_<Java File Name>.java
For example, to compile the first program, you can use the following command.
javac 1_Electricity.java
The serial number is the number in the first column of the table above.
-
Run the Java program using the following command.
java <Java File Name>.class
For example, to run the first program, you can use the following command.
java 1_Electricity.class
The programs are written in Java and compiled using the JDK version 17.0.2. on macOS Monterey 12.0.1.