diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/libraries/junit_4_13_2_javadoc.xml b/.idea/libraries/junit_4_13_2_javadoc.xml new file mode 100644 index 0000000..66e0bc1 --- /dev/null +++ b/.idea/libraries/junit_4_13_2_javadoc.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..2bfdeda --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0906b9b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Beginner/Beginner.iml b/Beginner/Beginner.iml new file mode 100644 index 0000000..5d514ba --- /dev/null +++ b/Beginner/Beginner.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson10/Lesson10.iml b/Beginner/Project1_ToDoList/Lesson10/Lesson10.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson10/Lesson10.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson11/Lesson11.iml b/Beginner/Project1_ToDoList/Lesson11/Lesson11.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson11/Lesson11.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson2/Lesson2.iml b/Beginner/Project1_ToDoList/Lesson2/Lesson2.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson2/Lesson2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson2/src/Main.java b/Beginner/Project1_ToDoList/Lesson2/src/DataTypesExample.java similarity index 78% rename from Beginner/Project1_ToDoList/Lesson2/src/Main.java rename to Beginner/Project1_ToDoList/Lesson2/src/DataTypesExample.java index 861e40a..aedfade 100644 --- a/Beginner/Project1_ToDoList/Lesson2/src/Main.java +++ b/Beginner/Project1_ToDoList/Lesson2/src/DataTypesExample.java @@ -1,10 +1,3 @@ -// HelloWorld.java -public class HelloWorld { - public static void main(String[] args) { - System.out.println("Hello, World!"); - } -} - // DataTypesExample.java public class DataTypesExample { public static void main(String[] args) { @@ -15,7 +8,7 @@ public static void main(String[] args) { // Displaying values System.out.println("Age: " + age); System.out.println("Name: " + NAME); - + // Example of primitive data types byte byteValue = 100; short shortValue = 1000; @@ -37,17 +30,17 @@ public static void main(String[] args) { } /* - * Output: - * Age: 22 - * Name: Nipuna - * Byte Value: 100 - * Short Value: 1000 - * Long Value: 100000 - * Float Value: 10.5 - * Double Value: 20.99 - * Char Value: A - * Boolean Value: true -*/ + * Output: + * Age: 22 + * Name: Nipuna + * Byte Value: 100 + * Short Value: 1000 + * Long Value: 100000 + * Float Value: 10.5 + * Double Value: 20.99 + * Char Value: A + * Boolean Value: true + */ /* Summary diff --git a/Beginner/Project1_ToDoList/Lesson2/src/HelloWorld.java b/Beginner/Project1_ToDoList/Lesson2/src/HelloWorld.java new file mode 100644 index 0000000..f0562ca --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson2/src/HelloWorld.java @@ -0,0 +1,7 @@ +// HelloWorld.java +public class HelloWorld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} + diff --git a/Beginner/Project1_ToDoList/Lesson3/Lesson3.iml b/Beginner/Project1_ToDoList/Lesson3/Lesson3.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson3/Lesson3.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson3/src/Main.java b/Beginner/Project1_ToDoList/Lesson3/src/ControlFlowExample.java similarity index 56% rename from Beginner/Project1_ToDoList/Lesson3/src/Main.java rename to Beginner/Project1_ToDoList/Lesson3/src/ControlFlowExample.java index 3ab9d23..15c2c6a 100644 --- a/Beginner/Project1_ToDoList/Lesson3/src/Main.java +++ b/Beginner/Project1_ToDoList/Lesson3/src/ControlFlowExample.java @@ -1,9 +1,5 @@ -/* -1. ControlFlowExample.java -This file demonstrates the use of conditional statements, including `if`, `else if`, `else`, and `switch`. -*/ - // ControlFlowExample.java + public class ControlFlowExample { public static void main(String[] args) { // Conditional Statements @@ -36,38 +32,6 @@ public static void main(String[] args) { } } -/* -2. LoopsExample.java -This file illustrates the different looping structures in Java: `for`, `while`, and `do-while` loops. -*/ - -// LoopsExample.java -public class LoopsExample { - public static void main(String[] args) { - // For Loop - System.out.println("For Loop:"); - for (int i = 0; i < 5; i++) { - System.out.println("Iteration: " + i); - } - - // While Loop - System.out.println("\nWhile Loop:"); - int j = 0; - while (j < 5) { - System.out.println("Iteration: " + j); - j++; - } - - // Do-While Loop - System.out.println("\nDo-While Loop:"); - int k = 0; - do { - System.out.println("Iteration: " + k); - k++; - } while (k < 5); - } -} - /* Summary diff --git a/Beginner/Project1_ToDoList/Lesson3/src/LoopsExample.java b/Beginner/Project1_ToDoList/Lesson3/src/LoopsExample.java new file mode 100644 index 0000000..8dfe7b3 --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson3/src/LoopsExample.java @@ -0,0 +1,40 @@ + +/* +2. LoopsExample.java +This file illustrates the different looping structures in Java: `for`, `while`, and `do-while` loops. +*/ + +// LoopsExample.java +public class LoopsExample { + public static void main(String[] args) { + // For Loop + System.out.println("For Loop:"); + for (int i = 0; i < 5; i++) { + System.out.println("Iteration: " + i); + } + + // While Loop + System.out.println("\nWhile Loop:"); + int j = 0; + while (j < 5) { + System.out.println("Iteration: " + j); + j++; + } + + // Do-While Loop + System.out.println("\nDo-While Loop:"); + int k = 0; + do { + System.out.println("Iteration: " + k); + k++; + } while (k < 5); + } +} + + +/* +Summary +- ControlFlowExample.java demonstrates how to use conditional statements and a switch statement. +- LoopsExample.java illustrates the use of `for`, `while`, and `do-while` loops. +- These examples provide a foundation for understanding control flow and looping structures in Java. +*/ \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson4/Lesson4.iml b/Beginner/Project1_ToDoList/Lesson4/Lesson4.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson4/Lesson4.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson4/src/FunctionExample.java b/Beginner/Project1_ToDoList/Lesson4/src/FunctionExample.java new file mode 100644 index 0000000..0999b08 --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson4/src/FunctionExample.java @@ -0,0 +1,24 @@ +// FunctionExample.java +public class FunctionExample { + + // Method to add two integers + public int add(int a, int b) { + return a + b; + } + + // Method to display user information + public void displayInfo(String name, int age) { + System.out.println("Name: " + name + ", Age: " + age); + } + + public static void main(String[] args) { + FunctionExample example = new FunctionExample(); // Create an instance of the class + + // Invoking the add method + int sum = example.add(5, 10); + System.out.println("Sum: " + sum); // Output: Sum: 15 + + // Invoking the displayInfo method + example.displayInfo("John", 25); + } +} diff --git a/Beginner/Project1_ToDoList/Lesson4/src/Main.java b/Beginner/Project1_ToDoList/Lesson4/src/MethodOverloadingExample.java similarity index 55% rename from Beginner/Project1_ToDoList/Lesson4/src/Main.java rename to Beginner/Project1_ToDoList/Lesson4/src/MethodOverloadingExample.java index 23feccd..00e6353 100644 --- a/Beginner/Project1_ToDoList/Lesson4/src/Main.java +++ b/Beginner/Project1_ToDoList/Lesson4/src/MethodOverloadingExample.java @@ -1,39 +1,5 @@ -/* -1. FunctionExample.java -This file demonstrates how to define, invoke, and work with methods, including using parameters and return types. -*/ - -// FunctionExample.java -public class FunctionExample { - - // Method to add two integers - public int add(int a, int b) { - return a + b; - } - - // Method to display user information - public void displayInfo(String name, int age) { - System.out.println("Name: " + name + ", Age: " + age); - } - - public static void main(String[] args) { - FunctionExample example = new FunctionExample(); // Create an instance of the class - - // Invoking the add method - int sum = example.add(5, 10); - System.out.println("Sum: " + sum); // Output: Sum: 15 - - // Invoking the displayInfo method - example.displayInfo("John", 25); - } -} - -/* -2. MethodOverloadingExample.java -This file illustrates method overloading by defining multiple methods with the same name but different parameters. -*/ - // MethodOverloadingExample.java + public class MethodOverloadingExample { // Overloaded method to multiply two integers diff --git a/Beginner/Project1_ToDoList/Lesson5/Lesson5.iml b/Beginner/Project1_ToDoList/Lesson5/Lesson5.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson5/Lesson5.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson6/Lesson6.iml b/Beginner/Project1_ToDoList/Lesson6/Lesson6.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson6/Lesson6.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson7/Lesson7.iml b/Beginner/Project1_ToDoList/Lesson7/Lesson7.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson7/Lesson7.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson8/Lesson8.iml b/Beginner/Project1_ToDoList/Lesson8/Lesson8.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson8/Lesson8.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Lesson9/Lesson9.iml b/Beginner/Project1_ToDoList/Lesson9/Lesson9.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Lesson9/Lesson9.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Beginner/Project1_ToDoList/Project1_ToDoList.iml b/Beginner/Project1_ToDoList/Project1_ToDoList.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Beginner/Project1_ToDoList/Project1_ToDoList.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Java-Project-Based-Learning.iml b/Java-Project-Based-Learning.iml new file mode 100644 index 0000000..c90834f --- /dev/null +++ b/Java-Project-Based-Learning.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file