diff --git a/README.md b/README.md
index 701c61e..f5bec88 100644
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ import java.util.Scanner;
### H_03_Inheritance in Java
-
+
## Message to Contributing
Contributions are always welcome! Whether you want to add new problems, improve solutions, or enhance documentation, feel free to create a pull request.
diff --git a/src/A_01_Primitive_Data_Types.java b/src/A_01_Primitive_Data_Types.java
new file mode 100644
index 0000000..0e0f0e8
--- /dev/null
+++ b/src/A_01_Primitive_Data_Types.java
@@ -0,0 +1,36 @@
+public class A_01_Primitive_Data_Types {
+ public static void main(String[] args) {
+ // In front of every datatypes there must be a Variable (e.g: int x = 1, where x is the Variable)
+ // Integers
+ System.out.println("Integers");
+ byte b = 10;
+ short s = 20;
+ int i = -30;
+ long l = 1000;
+ System.out.println(b);
+ System.out.println(s);
+ System.out.println(i);
+ System.out.println(l);
+
+ // Floating Point
+ System.out.println("Floating Point");
+ float f = 10.54f;
+ double d = 20.12;
+ System.out.println(f);
+ System.out.println(d);
+ System.out.println(f+d);
+
+ // Character
+ System.out.println("Characters");
+ char ch = 'A';
+ System.out.println(ch);
+
+ // Boolean
+ System.out.println("Boolean");
+ boolean bool = true;
+ boolean flag = false;
+ System.out.println(bool);
+ System.out.println(flag);
+
+ }
+}
\ No newline at end of file
diff --git a/src/A_02_Identifiers_Variable_Rules.java b/src/A_02_Identifiers_Variable_Rules.java
new file mode 100644
index 0000000..e5ff412
--- /dev/null
+++ b/src/A_02_Identifiers_Variable_Rules.java
@@ -0,0 +1,34 @@
+public class A_02_Identifiers_Variable_Rules {
+ public static void main(String[] args) {
+ // keyboard tip: Alt + z = To view all the contents
+ // keyboard tip: Ctrl + / = Comment a line
+
+ // Rules:
+ // 1) Variable Names can contain letters, digits, underscores, and dollar signs
+ // 2) Variable Names must begin with a letter, $ or _ (doesn't matter Uppercase or Lowercase)
+ // 3) Variable Names best practice should start with lowercase letter, and cannot contain whitespace
+ // 4) Variable Names are case-sensitive (e.g: "Name" and "name" are different variables)
+ // 5) Reserved words like Java keywords (e.g: int, boolean, char) cannot be used as Variable Names.
+
+ int a_1$ = 10;
+ int A_1$ = 10;
+
+ // as you can see there is an error as it has a white spacing in between.
+// int a_ 3$ = 10;
+
+ System.out.println(a_1$);
+ System.out.println(A_1$);
+
+ // this file will not run as there is an error
+// System.out.println(a_ 3$);
+
+ // similarly there will be an error cause you cannot use reserved words as Variable Names.
+// String int = 'Hello World!'
+// int String = 10;
+
+ // however, why does it work for this? It's cause the string is not a data type keyword *String* is not string. Hence, it why Java is case sensitive.
+ int string = 10;
+ System.out.println(string);
+
+ }
+}
diff --git a/src/A_03_Type_Casting.java b/src/A_03_Type_Casting.java
new file mode 100644
index 0000000..39b33d2
--- /dev/null
+++ b/src/A_03_Type_Casting.java
@@ -0,0 +1,21 @@
+public class A_03_Type_Casting {
+ // Implicit Type Casting (automatic by compiler)
+ // byte -> short -> char -> int -> long -> float -> double
+
+ // Explicit Type Casting
+ // double -> float -> long -> int -> char -> short -> byte
+
+ public static void main(String[] args) {
+ // Implicit
+ int number1 = 10;
+ double number2 = number1;
+
+ System.out.println(number2);
+
+ // Explicit
+ double num1 = 20.44;
+ int num2 = (int)num1;
+
+ System.out.print(num2);
+ }
+}
diff --git a/src/A_04_Arithmetic_Operators.java b/src/A_04_Arithmetic_Operators.java
new file mode 100644
index 0000000..5d0d51a
--- /dev/null
+++ b/src/A_04_Arithmetic_Operators.java
@@ -0,0 +1,28 @@
+public class A_04_Arithmetic_Operators {
+ public static void main(String[] args) {
+ // using the '+' operator you can join 2 Variable string together as shown below
+ String msg1 = "Hello World!";
+ String msg2 = "My name is Ang Jianming.";
+
+ System.out.println(msg1 + " " + msg2);
+
+ // Arithmetic Operator (+, -, *, /, %)
+ int a = 10;
+ int b = 20;
+
+ int c = a + b; // Addition
+ System.out.println(c);
+
+ int d = a - b; // Subtraction
+ System.out.println(d);
+
+ int e = a * b; // Multiply
+ System.out.println(e);
+
+ int f = b / a; // Divide
+ System.out.println(f);
+
+ int g = a % b; // Modulus
+ System.out.println(g);
+ }
+}
diff --git a/src/A_05_User_Input.java b/src/A_05_User_Input.java
new file mode 100644
index 0000000..daccbc3
--- /dev/null
+++ b/src/A_05_User_Input.java
@@ -0,0 +1,51 @@
+/*
+* Author AngJianming
+*
+*/
+
+// it is a must to import java.util.Scanner; to access some external files which has the functionality to read input from the console. In Java this is the way to get certain functionalities which is not build in therefore, needing to import them.
+
+import java.util.Scanner;
+
+public class A_05_User_Input {
+ public static void main(String[] args) {
+ Scanner user_input = new Scanner(System.in);
+ System.out.print("Enter your name: ");
+
+ String name = user_input.nextLine();
+ System.out.println("My name is " + name);
+
+
+ // Example Calculator
+ Scanner scanner = new Scanner(System.in);
+
+ // Prompt the user to enter the first number
+ System.out.print("Enter the first integer: ");
+ int x = scanner.nextInt();
+
+ // Prompt the user to enter the second number
+ System.out.print("Enter the second integer: ");
+ int y = scanner.nextInt();
+
+ // Perform arithmetic operations
+ int sum = x + y; // Addition
+ int difference = x - y; // Subtraction
+ int product = x * y; // Multiplication
+
+ // To handle division by zero, you can check if b == 0
+ // but for simplicity, we assume b != 0 in this example
+ double quotient = (double) x / y; // Division
+ int modulus = x % y; // Modulus (remainder)
+
+ // Print the results
+ System.out.println("\n--- Results ---");
+ System.out.println(x + " + " + y + " = " + sum);
+ System.out.println(x + " - " + y + " = " + difference);
+ System.out.println(x + " × " + y + " = " + product);
+ System.out.println(x + " ÷ " + y + " = " + quotient);
+ System.out.println(x + " % " + y + " = " +"R"+ modulus);
+
+ // Close the scanner
+ scanner.close();
+ }
+}
diff --git a/src/B_01_Assignment_Operators.java b/src/B_01_Assignment_Operators.java
new file mode 100644
index 0000000..a33eb7c
--- /dev/null
+++ b/src/B_01_Assignment_Operators.java
@@ -0,0 +1,24 @@
+public class B_01_Assignment_Operators {
+ public static void main(String[] args) {
+ // Assignment Operators (=, +=, -=, /=, *=)
+
+ int a = 10;
+ int b = 5;
+
+ a += b; // meaning a = a+b or a = 10+b
+ System.out.println(a);
+ // a = 15 this should be the expected result
+
+ a -= 2; // meaning a = a-2;
+ System.out.println(a);
+
+ a /= 2; // meaning a = a/2
+ System.out.println(a);
+
+ a *= 2; // meaning a = a*2
+ System.out.println(a);
+
+ a %= 5; // meaning a = a%5
+ System.out.println(a);
+ }
+}
diff --git a/src/B_02_Relational_Operators.java b/src/B_02_Relational_Operators.java
new file mode 100644
index 0000000..6cf6b6f
--- /dev/null
+++ b/src/B_02_Relational_Operators.java
@@ -0,0 +1,28 @@
+public class B_02_Relational_Operators {
+ // ture, false (boolean)
+ // Relational Operators ( ==, !=, <, >, <=, >=)
+
+ public static void main(String[] args) {
+ int a = 10;
+ int b = 15;
+
+ System.out.println(a == b); // if a is equal to b true, otherwise false
+ System.out.println(a != b); // 10 is not equal to 15 true, otherwise false
+ System.out.println(a < b); // 10 is less than 15 true, otherwise false
+ System.out.println(b > a); // 10 is more than 15 true, otherwise false
+
+ System.out.println(a <= b); // 10 is less or equal to 15 true, otherwise false
+
+ System.out.println(b >= a); // 10 is more than or equal to 15 true, otherwise false
+
+// 10 is less than, or equal to 10 true, otherwise false.
+ System.out.println(10 < 10); // is false because it cannot 10 cannot be less than 10
+ System.out.println(10 <= 10); // is true because it can be less than or EQUAL to 10 (Keyword 'equal')
+
+ System.out.println(10 > 10); // is false because it cannot 10 cannot be more than 10
+ System.out.println(10 >= 10); // is true because it can be more than or EQUAL to 10 (Keyword 'equal')
+
+
+
+ }
+}
diff --git a/src/B_03_Logical_Operators.java b/src/B_03_Logical_Operators.java
new file mode 100644
index 0000000..fc423ef
--- /dev/null
+++ b/src/B_03_Logical_Operators.java
@@ -0,0 +1,49 @@
+import java.security.spec.RSAOtherPrimeInfo;
+
+public class B_03_Logical_Operators {
+ public static void main(String[] args) {
+ // Logical Operator ( &&, ||, !)
+
+
+ // AND (&&) - is all condition is true then return true.
+// true && true = true
+// true && false = false
+// false && true = false
+// false && false = false
+ System.out.println(10>5);
+ System.out.println(20>14);
+ System.out.println((10>5) && (20>14));
+
+
+ // OR (||) - if any condition is true, then return true.
+// true || true = true
+// true || false = true
+// false || true = true
+// false || false = false
+ System.out.println((10>5) || (20<14));
+ System.out.println((10<5) || (20<14) || (10<2) || (1000<999) || (1<0));
+ // false, false, false, false, true. Hence, it's true still.
+
+ System.out.println((10<5) || (20<14) || (10<2) || (1000<999) || true);
+ // If at the end is true then all is true.
+
+ System.out.println((10<5) || (20<14) || (10<2) || (1000<999) || false);
+ // If at the end is all is false then false.
+
+
+ // NOT(!) - vice-versa
+// true = false
+// false = true
+
+ System.out.println(!(100>99)); // Not true. Therefore, false
+
+ System.out.println(!(100>99) && (2>0));
+ // !true AND true = false
+
+ System.out.println(!(20>20) || !(10<=20));
+ // !false OR !true = true
+
+
+
+ }
+}
diff --git a/src/B_04_Ternary_Operator.java b/src/B_04_Ternary_Operator.java
new file mode 100644
index 0000000..7bcd75a
--- /dev/null
+++ b/src/B_04_Ternary_Operator.java
@@ -0,0 +1,26 @@
+public class B_04_Ternary_Operator {
+ public static void main(String[] args) {
+ // Ternary Operator ( ?: )
+ // condition ? true : false
+
+ int n1 = 10;
+ int n2 = 20;
+
+// if (n2 is greater than n1) then n2 is assigned to variable greaterNum.
+
+ /*
+ * So the expression (n2 > n1) ? n2 : n1 means:
+ * - If n2 > n1 is true, then use n2.
+ * - Otherwise, use n1.
+ */
+ int greaterNum = (n2 > n1) ? n2 : n1;
+ System.out.println(greaterNum);
+
+ int n3 = 100;
+ int n4 = 20;
+
+ int greaterNum2 = (n3 > n4) ? n3 : n4;
+ System.out.println(greaterNum2);
+
+ }
+}
diff --git a/src/B_05_Increment_Operator.java b/src/B_05_Increment_Operator.java
new file mode 100644
index 0000000..b92392f
--- /dev/null
+++ b/src/B_05_Increment_Operator.java
@@ -0,0 +1,28 @@
+public class B_05_Increment_Operator {
+ public static void main(String[] args) {
+ // Increment Operator (++)
+
+ int a = 10;
+// a++; // post-increment (a = a+1)
+// ++a; // pre-increment (a = 1+a)
+
+ System.out.println(a);
+
+ a++;
+ a++;
+ System.out.println(a++);
+
+ ++a;
+ ++a;
+ System.out.println(++a);
+
+ System.out.println(a++);
+
+ System.out.println(++a);
+ // the reason why it's 18 insted of 17 is cause a++ will print out the current value 16 first, only after that it will add up to +1. Hence, the output for ++a would be 17+1 = 18;
+
+
+
+
+ }
+}
diff --git a/src/B_06_Decrement_Operator.java b/src/B_06_Decrement_Operator.java
new file mode 100644
index 0000000..fbe5bea
--- /dev/null
+++ b/src/B_06_Decrement_Operator.java
@@ -0,0 +1,16 @@
+public class B_06_Decrement_Operator {
+ public static void main(String[] args) {
+ // Decrement Operator (--)
+
+ int a = 20;
+// a--; // post
+// --a; // post
+
+ a--; // 19
+ System.out.println(a--); // 19 -> 18
+ System.out.println(--a); // 17
+
+ // Similar like increment operator it has to print out which ever variable comes first for this example 'a' comes first before the '++' so it will println 19 first but will minus it number afterwards.
+
+ }
+}
diff --git a/src/C_01_for_Loop.java b/src/C_01_for_Loop.java
new file mode 100644
index 0000000..c01e835
--- /dev/null
+++ b/src/C_01_for_Loop.java
@@ -0,0 +1,23 @@
+public class C_01_for_Loop {
+ public static void main(String[] args) {
+ // for loop
+
+// for(initial variable, condition, inc/dec from initial value) {
+// System.out.println(initial variable)
+// }
+
+ int i; // declare value
+ for(i=1; i<=5; i++) {
+ System.out.println(i);
+ } // {} this is a block condition
+
+ System.out.println("---After the for Loop---");
+ System.out.println(i);
+
+
+ // declared value can also be inside initial value
+ for(int b=1; b<=5; b++) {
+ System.out.println(b);
+ }
+ }
+}
diff --git a/src/C_02_while_Loop.java b/src/C_02_while_Loop.java
new file mode 100644
index 0000000..c37ece9
--- /dev/null
+++ b/src/C_02_while_Loop.java
@@ -0,0 +1,26 @@
+public class C_02_while_Loop {
+ public static void main(String[] args) {
+ //while loop
+
+// int initial variable=0; //declare variable first
+// while (condition) {
+// inc/dec
+// }
+
+ int i = 1; // declare value
+ while(i < 10) {
+ System.out.println(i);
+ i++;
+ }
+ // it will run, 1,2,3,4,5,6,7,8,9 but not 10 as we know i ≠ less than 10, as shown above
+
+ int j = 10; // declare value
+ while (j >= 1) {
+ System.out.println(j);
+ j--;
+ }
+ // it will run, 10,9,8,7,6,5,4,3,2,1 until 1 cause it's >= 1 | less than equal to 1
+ System.out.println("---j value after the Loop---");
+ System.out.println(j); // 0
+ }
+}
diff --git a/src/C_03_do_while_Loop.java b/src/C_03_do_while_Loop.java
new file mode 100644
index 0000000..582807e
--- /dev/null
+++ b/src/C_03_do_while_Loop.java
@@ -0,0 +1,39 @@
+public class C_03_do_while_Loop {
+ public static void main(String[] args) {
+ // do while loop
+
+// initial variable
+// do {
+// inc/dec
+// } while (condition);
+
+ int a = 1;
+ do {
+ System.out.println(a);
+ a++;
+ } while(a<=10);
+ // 1,2,3,4,5,6,7,8,9,10 cause it's less than and EQUAL to 10
+
+
+
+ int i = 1;
+ do {
+ System.out.println(i);
+ i = i+2;
+ } while(i<=10);
+ // 1,3,5,7,9 it starts with 1 as declared value, then move on with a +2 until <=10
+ // in order to find out whether 'i' have the value of 11 after the loop or not we can use
+ System.out.println("--after the do while Loop--");
+ System.out.println(i); // which indeed does have the value of 11 after the loop
+
+
+
+ int b = 10;
+ do {
+ System.out.println(b);
+ } while (b<5);
+ // 10<5, false cause the condition is executed before the block statement which is (b<5); in this case.
+
+
+ }
+}
diff --git a/src/C_04_break_Loop_Statement.java b/src/C_04_break_Loop_Statement.java
new file mode 100644
index 0000000..b195ddf
--- /dev/null
+++ b/src/C_04_break_Loop_Statement.java
@@ -0,0 +1,27 @@
+public class C_04_break_Loop_Statement {
+ public static void main(String[] args) {
+ // break statement
+
+ for (int i=1; i<=10; i++) {
+// System.out.println(i); // 1,2,3,4,5,6,7
+ // go out of the block if value is greater than and equal to 6.
+ if (i > 6) {
+ break;
+ }// this {} is the block remember
+
+ System.out.println(i);
+ // if println outside of block then it will only be until 6 cause the condition is aiming for after the block not before.
+ }
+
+ System.out.println("----------");
+
+ for (int j=1; j<=10; j++) {
+ if (j == 4) {
+ break;
+ // j == 4 means the number of figures, usually '==' | '>=' is the same figure but > only is not. And there cannot be '<' cause on the very first iteration, j = 1. The condition j <= 4 is true, so the break statement is immediately executed.
+ // This causes the for loop to terminate right away, without printing anything.
+ }
+ System.out.println(3+j); // 3+1 = 4, until the condition j == 4th figure then stop. So the output will only be until 3th figure.
+ }
+ }
+}
diff --git a/src/C_05_continue_Loop_Statement.java b/src/C_05_continue_Loop_Statement.java
new file mode 100644
index 0000000..59bdf64
--- /dev/null
+++ b/src/C_05_continue_Loop_Statement.java
@@ -0,0 +1,38 @@
+public class C_05_continue_Loop_Statement {
+ public static void main(String[] args) {
+ // continue statement
+
+ for (int i=1; i<=10; i++) {
+ if(i == 4) {
+ continue; // jump out the block, run it again
+ }
+ System.out.println(i); // 1,2,3,5,6,7,8,9,10 there is no 4 because the condition is met.
+
+ } // make sure the System.out.println(i); is inside of the for loop
+
+ System.out.println("------");
+
+ for (int i=1; i<=10; i++) {
+ if(i == 4 || i == 7) // this is the same as below
+ {
+ continue;
+ }
+ System.out.println(i); // 4 and 7 will not be shown.
+
+ }
+
+ System.out.println("------");
+
+ for (int i=1; i<=10; i++) {
+ if(i == 4) // same as above either way also works but the above is better and faster.
+ {
+ continue;
+ }
+ if(i == 7) {
+ continue;
+ }
+ System.out.println(i);
+
+ }
+ } // the 'if' is based of true || false
+}
diff --git a/src/D_01_if_else_Statement.java b/src/D_01_if_else_Statement.java
new file mode 100644
index 0000000..4dd7b65
--- /dev/null
+++ b/src/D_01_if_else_Statement.java
@@ -0,0 +1,37 @@
+public class D_01_if_else_Statement {
+ public static void main(String[] args) {
+ // if else statement
+
+// if (condition) {
+//
+// } else {
+//
+// }
+
+
+ int a = 10;
+ if (a > 0) { // 10 is greater than 0, then if statement will run
+ System.out.println("a is greater");
+ }
+
+ if (a > 11) { // 10 is greater than 11, then if statement will run. If it is false then it will not run.
+ System.out.println("a is less than 11");
+ }
+
+ if (true) { // 10 is greater than 11, then if statement will run. If it is false then it will not run.
+ System.out.println("a is true");
+ }
+
+ // test around with these condition with Arithmetic Operations
+ int x = 20;
+ int y = 30;
+
+ if (!(x < y)) {
+ System.out.println(x);
+ } else {
+ System.out.println(y);
+ }
+
+
+ }
+}
diff --git a/src/D_02_if_elseif_else_Statement.java b/src/D_02_if_elseif_else_Statement.java
new file mode 100644
index 0000000..929b34f
--- /dev/null
+++ b/src/D_02_if_elseif_else_Statement.java
@@ -0,0 +1,31 @@
+public class D_02_if_elseif_else_Statement {
+ public static void main(String[] args) {
+ // if elseif else statement
+
+// if (condition) {
+//
+// } else if (condition) {
+//
+// } else {
+//
+// }
+
+
+ // example on how to use if elseif else, else if can be used as many times as you need.
+ int a = 5;
+ int b = 12;
+ int c = 10;
+
+ if (a < b) {
+ System.out.println(a + " is less than " + b);
+
+ } else if (c > b) {
+ System.out.println(c + " is greater than " + b);
+
+ } else {
+ int result = a+b;
+ System.out.println("The result is: " + result);
+ }
+
+ }
+}
diff --git a/src/D_03_if_else_Ladder.java b/src/D_03_if_else_Ladder.java
new file mode 100644
index 0000000..5b40e3e
--- /dev/null
+++ b/src/D_03_if_else_Ladder.java
@@ -0,0 +1,25 @@
+public class D_03_if_else_Ladder {
+ public static void main(String[] args) {
+ // if else Ladder
+
+ int a = 10;
+
+ if (a==10) {
+ System.out.println("10 is present in a.");
+
+ } else if (a==20) {
+ System.out.println("20 is present in a.");
+
+ } else if (a==30) {
+ System.out.println("30 is present in a.");
+
+ } else if (a==40) {
+ System.out.println("40 is present in a.");
+
+ } else {
+ System.out.println("Wrong Input");
+ }
+
+
+ }
+}
diff --git a/src/D_04_Nested_if_else.java b/src/D_04_Nested_if_else.java
new file mode 100644
index 0000000..b1b733f
--- /dev/null
+++ b/src/D_04_Nested_if_else.java
@@ -0,0 +1,53 @@
+public class D_04_Nested_if_else {
+ public static void main(String[] args) {
+ // nested if else
+
+// if (condition1) {
+// // Code to execute when condition1 is true
+//
+// if (condition2) {
+// // Code to execute when condition1 is true AND condition2 is true
+// } else {
+// // Code to execute when condition1 is true AND condition2 is false
+// }
+// } else {
+// // Code to execute when condition1 is false
+//
+// if (condition3) {
+// // Code to execute when condition1 is false AND condition3 is true
+// } else {
+// // Code to execute when condition1 is false AND condition3 is false
+// }
+// }
+
+
+ // Example
+ int number = 20; // test case
+ if (number > 0) {
+ System.out.println(number + " is positive.");
+
+ if (number > 10) {
+ System.out.println(number + " is also greater than 10.");
+ } else {
+ System.out.println(number + " is not greater than 10.");
+ }
+
+ } else {
+ System.out.println(number + " is not positive.");
+
+ if (number == 0) {
+ System.out.println("Actually, it's 0.");
+ } else {
+ System.out.println("And it's negative.");
+ }
+ }
+
+ //- Outer if checks if number is greater than 0.
+
+ //- If true, it prints a message and then nested if checks if number is greater than 10.
+
+ //- If false, the else part prints that the number is not positive, and another nested if-else checks whether number is exactly 0 or negative.
+
+
+ }
+}
diff --git a/src/D_05_switch_Statement.java b/src/D_05_switch_Statement.java
new file mode 100644
index 0000000..3687bbe
--- /dev/null
+++ b/src/D_05_switch_Statement.java
@@ -0,0 +1,62 @@
+public class D_05_switch_Statement {
+ public static void main(String[] args) {
+ // switch Statement
+
+// switch (expression) {
+// case value1:
+// // Code block when expression == value1
+// break; // optional, but often used to prevent "fall-through"
+//
+// case value2:
+// // Code block when expression == value2
+// break;
+
+// // You can have as many cases as needed.
+// default:
+// // Code block if expression doesn't match any case
+// }
+
+// expression: A value or variable that the switch will evaluate. This expression must result in a value of type byte, short, char, int, String, or an enum (and their corresponding wrapper classes in newer Java versions).
+
+// case value: Each case compares the expression against a constant. If the expression matches this constant, the code for that case executes.
+
+// break: The break statement prevents "fall-through", meaning that the program will exit the switch block once that case executes. Without a break, execution would continue to subsequent cases even if they don't match.
+
+// default: The optional default case runs if none of the specified cases match the expression. It’s like the else in an if-else-if structure.
+
+
+ // Example
+ int day = 4;
+ String dayName;
+
+ switch (day) {
+ case 1:
+ dayName = "Monday";
+ break;
+ case 2:
+ dayName = "Tuesday";
+ break;
+ case 3:
+ dayName = "Wednesday";
+ break;
+ case 4:
+ dayName = "Thursday";
+ break;
+ case 5:
+ dayName = "Friday";
+ break;
+ case 6:
+ dayName = "Saturday";
+ break;
+ case 7:
+ dayName = "Sunday";
+ break;
+ default:
+ dayName = "Invalid day";
+ break;
+ }
+
+ System.out.println("The day is: " + dayName);
+
+ }
+}
diff --git a/src/E_01_Function_Types.java b/src/E_01_Function_Types.java
new file mode 100644
index 0000000..356fd64
--- /dev/null
+++ b/src/E_01_Function_Types.java
@@ -0,0 +1,34 @@
+public class E_01_Function_Types {
+ public static void main(String[] args) {
+ // Functions
+ // it is not possible to add a function in a main function
+// Hence, it is added out of the main function
+
+ nameFunction(); // call the method/function
+
+ // if without 'static void' only 'void' it will have an error calling.
+
+ printSum();
+ }
+
+ // data type(return type), name
+ static void nameFunction() {
+ // write your code here
+ System.out.println("Hello World! I'm Ang Jianming");
+ }
+
+ static void printSum() {
+ int a = 10;
+ int b = 20;
+ System.out.println(a + b);
+ }
+
+
+ /* There is 4 types of Functions
+ - 1. No return type with No argument
+ - 2. Return type with No argument
+ - 3. No Return type with argument
+ - 4. Return type with argument
+ */
+}
+
diff --git a/src/E_02_Type1_No_Return_Type_with_No_Argument.java b/src/E_02_Type1_No_Return_Type_with_No_Argument.java
new file mode 100644
index 0000000..00c189f
--- /dev/null
+++ b/src/E_02_Type1_No_Return_Type_with_No_Argument.java
@@ -0,0 +1,15 @@
+public class E_02_Type1_No_Return_Type_with_No_Argument {
+ // Type 1 - No Return Type with No Argument
+
+ static void addTwoNumber(){
+ // void - null, it will return nothing
+
+ int a = 5;
+ int b = 10;
+ System.out.println(a + b);
+ }
+
+ public static void main(String[] args) {
+ addTwoNumber();
+ }
+}
diff --git a/src/E_03_Type2_Return_Type_with_No_Argument.java b/src/E_03_Type2_Return_Type_with_No_Argument.java
new file mode 100644
index 0000000..91ad66b
--- /dev/null
+++ b/src/E_03_Type2_Return_Type_with_No_Argument.java
@@ -0,0 +1,32 @@
+public class E_03_Type2_Return_Type_with_No_Argument {
+ // Type 2 - Return Type with No Argument
+
+ static int subtract(){
+ int a = 20;
+ int b = 10;
+ int result = a - b;
+
+ return result;
+ }
+
+ static String getMyName(){
+ // String name = "Ang Jianming";
+ // return name; these are same as return "something"
+
+ return "Ang Jianming";
+
+// System.out.println() this is not need if there is a return type.
+
+ }
+
+ public static void main(String[] args) {
+ int res = subtract(); // it will return value as int
+
+ System.out.println(res); // value 10
+ // or, both is fine chose which is more simple to your preferences
+ System.out.println(subtract()); // value 10
+
+
+ System.out.println(getMyName());
+ }
+}
diff --git a/src/E_04_Type3_No_Return_Type_with_Argument.java b/src/E_04_Type3_No_Return_Type_with_Argument.java
new file mode 100644
index 0000000..da0e644
--- /dev/null
+++ b/src/E_04_Type3_No_Return_Type_with_Argument.java
@@ -0,0 +1,21 @@
+public class E_04_Type3_No_Return_Type_with_Argument {
+ // Type 3 - No Return Type with Argument
+
+ static void printName (String name) { // (data type, variable)
+ System.out.println(name);
+ }
+
+ static void sumOfThreeNumber (int n1, int n2, int n3) {
+ int result = n1 + n2 + n3;
+ System.out.println(result);
+ }
+
+ public static void main(String[] args) {
+ printName("Ang Jianming");
+
+ // call the function
+ sumOfThreeNumber(10, 20, 30);
+
+
+ }
+}
diff --git a/src/E_05_Type4_Return_Type_with_Argument.java b/src/E_05_Type4_Return_Type_with_Argument.java
new file mode 100644
index 0000000..ec85475
--- /dev/null
+++ b/src/E_05_Type4_Return_Type_with_Argument.java
@@ -0,0 +1,22 @@
+public class E_05_Type4_Return_Type_with_Argument {
+ // Type 4 - Return Type with Argument
+
+ static int multiplicationOfTwoNumbers(int a, int b) {
+ int result = a * b;
+ return result; // return value
+ }
+
+ // it's up to the developer whether they would like to use double as a data type of other.
+ static double addFourNumbers(double n1, double n2, double n3, double n4) {
+ return (int) (n1 + n2 + n3 + n4); // return type
+ }
+
+ public static void main(String[] args) {
+ // call the func
+ System.out.println(multiplicationOfTwoNumbers(2, 5));
+
+ System.out.println(addFourNumbers(1.0, 2.0, 3.3, 4.7)); // 11.0
+
+ // this shows that the number is added at the main function not in the parent function.
+ }
+}
diff --git a/src/F_01_Arrays.java b/src/F_01_Arrays.java
new file mode 100644
index 0000000..d7e54a4
--- /dev/null
+++ b/src/F_01_Arrays.java
@@ -0,0 +1,35 @@
+public class F_01_Arrays {
+ // What is an Array & Why we use Array?
+
+ public static void main(String[] args) {
+// the array are stored in box with how any amount of elements
+// |40|55|63|17|22|68|89|97|89|
+
+ String[] toys = new String[5];
+
+/* In Java, an array is like that row of cubbyholes:
+
+ - It can store many pieces of the same type of information (like a list of numbers or a list of words).
+
+ - Each spot in the array has a special number called an index that tells you its position (just like how each cubbyhole has a label).
+*/
+// Example with toys:
+// Think of an array like a toy box with 5 spaces:
+// Space 0: Teddy Bear
+// Space 1: Car
+// Space 2: Doll
+// Space 3: Ball
+// Space 4: Robot
+
+ toys[0] = "Teddy Bear";
+ toys[1] = "Car";
+ toys[2] = "Doll";
+ toys[3] = "Ball";
+ toys[4] = "Robot";
+
+ System.out.println(toys[2]);
+
+
+
+ }
+}
diff --git a/src/F_02_Create_an_Array.java b/src/F_02_Create_an_Array.java
new file mode 100644
index 0000000..915d206
--- /dev/null
+++ b/src/F_02_Create_an_Array.java
@@ -0,0 +1,31 @@
+import javax.sound.midi.SysexMessage;
+
+public class F_02_Create_an_Array {
+ // Create an Array
+ public static void main(String[] args) {
+ // 1st way
+ int [] arr = new int[] {10, 20,30,40,50,60};
+ System.out.println(arr); // there will have a wrong outcome [I@7b23ec81
+ System.out.println(arr.length); // this println the number of elements in a array there is 6 here.
+ System.out.println(arr[0]); // this shows the which element you want to println.
+
+ // 2nd way
+ int[] arr2 = new int[3];
+ arr2[0] = 10;
+ arr2[1] = 20;
+ arr2[2] = 30;
+ System.out.println(arr2[0]);
+ System.out.println(arr2[1]);
+ System.out.println(arr2[2]);
+
+ // 3rd way
+ int[] arr3;
+ arr3 = new int[3];
+ arr3[0] = 100;
+ arr3[1] = 200;
+ System.out.println(arr3[0]);
+ System.out.println(arr3[1]);
+
+
+ }
+}
diff --git a/src/F_03_Print_Array_using_Loops.java b/src/F_03_Print_Array_using_Loops.java
new file mode 100644
index 0000000..72b270d
--- /dev/null
+++ b/src/F_03_Print_Array_using_Loops.java
@@ -0,0 +1,25 @@
+public class F_03_Print_Array_using_Loops {
+ //println Array using Loop
+ public static void main(String[] args) {
+ int[] arr = new int[] {10,20,30,40,50,60,70};
+ System.out.println(arr);
+
+ // for loop, or can use while loop
+ for(int i = 0; i < arr.length; i++) {
+ System.out.println(arr[i]); // 10,20,30,40,50,60,70, after will not go beyond 80 cause it's i++ the 'i' comes first before the '++'
+
+ }
+ System.out.println("------");
+ // 7-2 = 5 so only until 50
+ for(int i = 0; i < arr.length-2; i++) {
+ System.out.println(arr[i]); // 10,20,30,40,50 after will not go beyond 60 cause it's i++ the 'i' comes first before the '++'
+
+ }
+ System.out.println("------");
+ int j=0;
+ while(j