diff --git a/.gitignore b/.gitignore
index 1b124fb..3ae2564 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,4 +19,4 @@ Thumbs.db
*.class
*.jar
*.war
-*.ear
\ No newline at end of file
+*.ear
diff --git a/Basics/src/Main.java b/Basics/src/Main.java
new file mode 100644
index 0000000..494f368
--- /dev/null
+++ b/Basics/src/Main.java
@@ -0,0 +1,7 @@
+//TIP To Run code, press or
+// click the icon in the gutter.
+public class Main {
+ public static void main(String[] args) {
+
+ }
+}
\ No newline at end of file
diff --git a/README.md b/README.md
deleted file mode 100644
index a62bdb9..0000000
--- a/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Java Learning Hub
-
-Welcome to **Java Learning Hub** — my personal journey of learning Java.
-This repository contains example programs, notes, and experiments I’ve created while exploring Java step by step.
-
----
-
-## 📌 What’s Inside
-
-* **Beginner Programs**: Basic syntax, variables, data types, and operators.
-* **Practical Examples**: Small Java programs solving real problems.
-* **Docs**: Notes on Java concepts (`docs/` folder).
-
----
-
-## 🚀 Getting Started
-
-### 1. Fork the Repository
-
-Click the **Fork** button at the top right of this page to create your own copy under your GitHub account.
-
-### 2. Clone the Repository
-
-```bash
-git clone https://github.com/vikashkrdeveloper/java-learning-hub.git
-cd java-learning-hub
-```
-
-### 3. Compile and Run Java Programs
-
-For **Windows/macOS/Linux**:
-
-```bash
-javac code/basics/FirstProgram.java
-java code.basics.FirstProgram
-```
-
-> **Note:** Make sure you have the **Java JDK** installed. You can check with:
->
-> ```bash
-> java -version
-> javac -version
-> ```
-
-If not installed, download the latest JDK from:
-👉 [Oracle JDK](https://www.oracle.com/java/technologies/javase-downloads.html)
-👉 [OpenJDK](https://openjdk.org/)
-
-### 4. Explore and Learn
-
-Browse the folders and files to see different Java examples and notes.
-Feel free to modify and experiment with the code!
-
----
-
-## 📚 Resources
-
-* [Java Official Documentation](https://docs.oracle.com/javase/)
-* [W3Schools Java Tutorial](https://www.w3schools.com/java/)
-* [GeeksforGeeks Java](https://www.geeksforgeeks.org/java/)
-* [Baeldung Java Tutorials](https://www.baeldung.com/java-tutorial)
-
----
-
-## 🙏 Thank You
-
-Thanks for visiting my Java Learning Hub!
-If you have any questions or suggestions, feel free to open an issue or reach out.
-Happy coding! 🚀
diff --git a/codes/Basics/01Main.java b/codes/Basics/01Main.java
deleted file mode 100644
index 04214d0..0000000
--- a/codes/Basics/01Main.java
+++ /dev/null
@@ -1,8 +0,0 @@
-class Main {
- public static void main(String[] args) {
- System.out.println("Jai Shri Krishna!|| Jai Shri Ram!"); // Print a greeting message
- for (int i = 1; i <= 5; i++) { - System.out.println("i = ==> (" + i + ")"); // Print the value of i in each iteration [1, 2, 3, 4, 5]
- }
- }
-}
\ No newline at end of file
diff --git a/codes/Basics/02Variables.java b/codes/Basics/02Variables.java
deleted file mode 100644
index 674d412..0000000
--- a/codes/Basics/02Variables.java
+++ /dev/null
@@ -1,27 +0,0 @@
-class Variables {
- public static void main(String[] args) {
- // Variable declaration and initialization
- int myNumber = 10;
- String myString = "Hello, World!";
- double myDouble = 5.99;
- boolean myBoolean = true;
-
- // Printing variables
- System.out.println("Integer: ==> " + myNumber);
- System.out.println("String: ==> " + myString);
- System.out.println("Double: ==> " + myDouble);
- System.out.println("Boolean: ==> " + myBoolean);
-
- // Changing variable values
- myNumber = 20;
- myString = "Goodbye, World!";
- myDouble = 10.99;
- myBoolean = false;
-
- // Printing updated variables
- System.out.println("Updated Integer: ==> " + myNumber);
- System.out.println("Updated String: ==> " + myString);
- System.out.println("Updated Double: ==> " + myDouble);
- System.out.println("Updated Boolean: ==> " + myBoolean);
- }
-}
diff --git a/codes/Basics/03DataTypes.java b/codes/Basics/03DataTypes.java
deleted file mode 100644
index defbd7f..0000000
--- a/codes/Basics/03DataTypes.java
+++ /dev/null
@@ -1,37 +0,0 @@
-class DataTypes {
- public static void main(String[] args) {
- // Primitive Data Types
- byte myByte = 1;
- int myInt = 100;
- short myShort = 10;
- long myLong = 1000L;
- float myFloat = 10.5f;
- double myDouble = 99.99;
- char myChar = 'A';
- boolean myBoolean = true;
-
- // Non-Primitive Data Types
- String myString = "Hello, Java!";
- int[] myArray = {1, 2, 3, 4, 5};
- Object myObject = new Object();
-
-
- // Printing Primitive Data Types
- System.out.println("Byte: " + myByte);
- System.out.println("Short: " + myShort);
- System.out.println("Long: " + myLong);
- System.out.println("Float: " + myFloat);
- System.out.println("Integer: " + myInt);
- System.out.println("Double: " + myDouble);
- System.out.println("Character: " + myChar);
- System.out.println("Boolean: " + myBoolean);
-
- // Printing Non-Primitive Data Types
- System.out.println("String: " + myString);
- System.out.print("Array: ");
- for (int num : myArray) {
- System.out.print(num + " ");
- }
- System.out.println("\nObject: " + myObject.toString());
- }
-}
diff --git a/codes/Basics/04UserInput.java b/codes/Basics/04UserInput.java
deleted file mode 100644
index 426878c..0000000
--- a/codes/Basics/04UserInput.java
+++ /dev/null
@@ -1,15 +0,0 @@
-import java.util.Scanner;
-
-class UserInput {
- public static void main(String[] args) {
- System.out.print("Enter your name: ");
- Scanner input = new Scanner(System.in);
- String name = input.nextLine();
- System.out.println("Hello, " + name + "! Welcome to Java programming.");
-
- // Enter age
- System.out.print("Enter your age: ");
- int age = input.nextInt();
- System.out.println("You are " + age + " years old.");
- }
-}
diff --git a/codes/Basics/05SumOfTwoNumber.java b/codes/Basics/05SumOfTwoNumber.java
deleted file mode 100644
index e5016fa..0000000
--- a/codes/Basics/05SumOfTwoNumber.java
+++ /dev/null
@@ -1,17 +0,0 @@
-import java.util.Scanner;
-
-class SumOfTwoNumber {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter first number: ");
- int num1 = input.nextInt();
-
- System.out.print("Enter second number: ");
- int num2 = input.nextInt();
-
- int sum = num1 + num2;
-
- System.out.println("Sum of two number " + num1 + " and " + num2 + " is : " + sum);
-
- }
-}
diff --git a/codes/Basics/06TypeConversion.java b/codes/Basics/06TypeConversion.java
deleted file mode 100644
index 0312e98..0000000
--- a/codes/Basics/06TypeConversion.java
+++ /dev/null
@@ -1,22 +0,0 @@
-class TypeConversion {
- public static void main(String[] args) {
- // Type Conversion
- // Type1: Implicit Type Conversion (Widening) - Automatic (Coercion)
- int intValue = 44;
- double doubleValue = intValue; // int to double
- System.out.println("Implicit Type Conversion (Widening): ==> (" + doubleValue + ")");
- long big = 45;
- float dec = 5;
- double d = 5.4f;
- System.out.println("Implicit Type Conversion (Widening) examples: ==> (" + big + "), (" + dec + "), (" + d + ")");
-
- // Type2: Explicit Type Conversion (Narrowing) - Manual (Casting)
- double anotherDoubleValue = 9.78;
- int anotherIntValue = (int) anotherDoubleValue; // double to int
- System.out.println("\nExplicit Type Conversion (Narrowing): ==> (" + anotherIntValue + ")");
- float eDic = (float) 5.4;
- long eBig = (long) 5.4;
- int eInt = (int) 5.4;
- System.out.println("Explicit Type Conversion (Narrowing) examples: ==> (" + eDic + "), (" + eBig + "), (" + eInt + ")");
- }
-}
diff --git a/codes/Basics/ArraysCode.java b/codes/Basics/ArraysCode.java
deleted file mode 100644
index 0a6433a..0000000
--- a/codes/Basics/ArraysCode.java
+++ /dev/null
@@ -1,24 +0,0 @@
-public class ArraysCode {
- public static void main(String[] args) {
- // Declare and initialize an array of integers
- int[] numbers = {10, 20, 30, 40, 50};
-
- // Get the length of the array
- int length = numbers.length;
- System.out.println("Length of the array: " + length);
-
- // Access elements in the array using their index
- System.out.println("Element at index 0: " + numbers[0]);
- System.out.println("Element at index 2: " + numbers[2]);
-
- // Modify an element in the array
- numbers[1] = 25;
- System.out.println("Modified element at index 1: " + numbers[1]);
-
- // Iterate through the array and print all elements
- System.out.print("Array elements: ");
- for (int i = 0; i < numbers.length; i++) { - System.out.print(numbers[i] + " "); - } - } -} diff --git a/codes/Basics/ClassesCode.java b/codes/Basics/ClassesCode.java deleted file mode 100644 index 8df39a8..0000000 --- a/codes/Basics/ClassesCode.java +++ /dev/null @@ -1,35 +0,0 @@ -public class ClassesCode { - // A simple class representing a Dog - static class Dog { - // Attributes (fields) of the Dog class - String name; - int age; - - // Constructor to initialize a Dog object - Dog(String name, int age) { - this.name = name; - this.age = age; - } - - // Method to make the dog bark - void bark() { - System.out.println(name + " says: Woof Woof! ==> ");
- }
-
- // Method to get the dog's age in human years
- int getAgeInHumanYears() {
- return age * 7;
- }
- }
-
- public static void main(String[] args) {
- // Creating an instance (object) of the Dog class
- Dog myDog = new Dog("Buddy ==> ", 3);
-
- // Accessing attributes and methods of the Dog object
- System.out.println("My dog's name is: " + myDog.name);
- System.out.println("My dog is " + myDog.age + " years old.");
- myDog.bark();
- System.out.println("My dog's age in human years is: " + myDog.getAgeInHumanYears());
- }
-}
diff --git a/codes/Basics/FunctionAndMethods.java b/codes/Basics/FunctionAndMethods.java
deleted file mode 100644
index 695bef2..0000000
--- a/codes/Basics/FunctionAndMethods.java
+++ /dev/null
@@ -1,29 +0,0 @@
-public class FunctionAndMethods {
- // A method that takes two integers as parameters and returns their sum
- public static int add(int a, int b) {
- return a + b;
- }
-
- // A method that takes a string as a parameter and prints it in uppercase
- public static void printUpperCase(String str) {
- System.out.println(str.toUpperCase());
- }
-
- public static void main(String[] args) {
- // Calling the add method and storing the result ==>
- int sum = add(5, 10);
- System.out.println("Sum: ==> " + sum);
-
- // Calling the printUpperCase method ==>
- printUpperCase("hello, world! ==> ");
- }
-
- // Difference between function and method in Java:
- // In Java, a method is a block of code that is associated with an object or class.
- // A function is a more general term that refers to a block of code that performs a specific task and can be called independently.
- // In Java, all functions are methods, but not all methods are functions.
-
- // Difference between static and non-static methods:
- // Static methods belong to the class and can be called without creating an instance of the class.
- // Non-static methods belong to an instance of the class and require an object of the class to be created before they can be called.
-}
diff --git a/codes/Basics/StringCodes.java b/codes/Basics/StringCodes.java
deleted file mode 100644
index 1fbe0d6..0000000
--- a/codes/Basics/StringCodes.java
+++ /dev/null
@@ -1,32 +0,0 @@
-public class StringCodes {
- public static void main(String[] args) {
- String str = "Hello, World! ==> Java String Methods";
-
- // Get the length of the string
- int length = str.length();
- System.out.println("Length: ==> (" + length + ")");
-
- // Get a character at a specific index
- char charAtIndex = str.charAt(7);
- System.out.println("Character at index 7: ==> (" + charAtIndex + ")");
-
- // Get the Unicode code point of a character at a specific index
- int codePointAtIndex = str.codePointAt(7);
- System.out.println("Unicode code point at index 7: ==> (" + codePointAtIndex + ")");
-
- // Get the Unicode code point before a specific index
- int codePointBeforeIndex = str.codePointBefore(7);
- System.out.println("Unicode code point before index 7: ==> (" + codePointBeforeIndex + ")");
-
- // Get the Unicode code point count in a substring
- int codePointCount = str.codePointCount(0, str.length());
- System.out.println("Total Unicode code points in the string: ==> (" + codePointCount + ")");
-
- // Convert the string to an array of characters
- char[] charArray = str.toCharArray();
- System.out.print("Character array: ==> ");
- for (char c : charArray) {
- System.out.print(c + " ");
- }
- }
-}
diff --git a/codes/FirstProgram.java b/codes/FirstProgram.java
deleted file mode 100644
index a96e7d2..0000000
--- a/codes/FirstProgram.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package codes;
-
-public class FirstProgram {
- public static void main(String[] args) {
- String[] lordNamesList = {"Jai Shri Krishna जय श्री कृष्ण \uD83E\uDD9A\uD83E\uDDFF", "Jai Shri Ram जय श्री राम \uD83D\uDE4F\uD83C\uDFFB", "Jai Hanuman जय हनुमान \uD83D\uDC51", "Jai Mata Di जय माता दी \uD83D\uDE4F\uD83C\uDFFB", "Jai Bhole Nath जय भोलेनाथ \uD83D\uDC7A", "Jai Ganesha जय गणेश \uD83D\uDC30", "Jai Surya देवो भव"};
-
- for (String name : lordNamesList) {
- System.out.println(name);
- }
- }
-}
\ No newline at end of file
diff --git a/codes/GoodMorning.java b/codes/GoodMorning.java
deleted file mode 100644
index ce77a1d..0000000
--- a/codes/GoodMorning.java
+++ /dev/null
@@ -1,10 +0,0 @@
-import java.lang.*;
-
-public class GoodMorning{
- public static void main(String[] args){
- System.out.println("Jai Shree Ram");
- System.out.println("Good Morning!");
- System.out.println("Good Morning!");
- System.out.println("Good Morning!");
- }
-}
diff --git a/codes/Operators If-Else & Number System/01 SwapTwoNumber.java b/codes/Operators If-Else & Number System/01 SwapTwoNumber.java
deleted file mode 100644
index 81d6f1a..0000000
--- a/codes/Operators If-Else & Number System/01 SwapTwoNumber.java
+++ /dev/null
@@ -1,37 +0,0 @@
-import java.util.Scanner;
-
-class SwapTwoNumber {
- public static void main(String[] args) {
- int a = 5;
- int b = 10;
-
- System.out.println("Before swapping: a = " + a + ", b = " + b);
-
- // Swapping using a temporary variable
- int temp = a;
- a = b;
- b = temp;
-
- System.out.println("After swapping: a = " + a + ", b = " + b);
-
- // Swapping back without using a temporary variable
- a = a + b; // a now becomes 15
- b = a - b; // b becomes 5
- a = a - b; // a becomes 10
- System.out.println("After swapping back: a = " + a + ", b = " + b);
-
- // Assigning values using Scanner
- Scanner input = new Scanner(System.in);
- System.out.print("Enter first number: ");
- a = input.nextInt();
- System.out.print("Enter second number: ");
- b = input.nextInt();
- System.out.println("You entered: a = " + a + ", b = " + b);
-
- // Swapping number
- a = a + b; // a now becomes sum of a and b
- b = a - b; // b becomes original a
- a = a - b; // a becomes original b
- System.out.println("After swapping: a = " + a + ", b = " + b);
- }
-}
diff --git a/codes/Operators If-Else & Number System/02 ArithmeticOperator.java b/codes/Operators If-Else & Number System/02 ArithmeticOperator.java
deleted file mode 100644
index 417ac15..0000000
--- a/codes/Operators If-Else & Number System/02 ArithmeticOperator.java
+++ /dev/null
@@ -1,23 +0,0 @@
-import java.util.Scanner;
-
-class ArithmeticOperator {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter your first number: ");
- int a = input.nextInt();
- System.out.print("Enter your second number: ");
- int b = input.nextInt();
-
- int addition = a + b;
- int subtraction = a - b;
- int multiplication = a * b;
- int division = a / b;
- int modulus = a % b;
-
- System.out.println("Addition: ==> (" + addition + ")");
- System.out.println("Subtraction: ==> (" + subtraction + ")");
- System.out.println("Multiplication: ==> (" + multiplication + ")");
- System.out.println("Division: ==> (" + division + ")");
- System.out.println("Modulus: ==> (" + modulus + ")");
- }
-}
diff --git a/codes/Operators If-Else & Number System/03 ShorthandOperator.java b/codes/Operators If-Else & Number System/03 ShorthandOperator.java
deleted file mode 100644
index 249ac72..0000000
--- a/codes/Operators If-Else & Number System/03 ShorthandOperator.java
+++ /dev/null
@@ -1,21 +0,0 @@
-import java.util.Scanner;
-
-class ShorthandOperator {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter your first number: ");
- int a = input.nextInt();
- System.out.print("Enter your second number: ");
- int b = input.nextInt();
- a += b; // a = a + b
- System.out.println("After a += b, a ==> (" + a + ")");
- a -= b; // a = a - b
- System.out.println("After a -= b, a ==> (" + a + ")");
- a *= b; // a = a * b
- System.out.println("After a *= b, a ==> (" + a + ")");
- a /= b; // a = a / b
- System.out.println("After a /= b, a ==> (" + a + ")");
- a %= b; // a = a % b
- System.out.println("After a %= b, a ==> (" + a + ")");
- }
-}
\ No newline at end of file
diff --git a/codes/Operators If-Else & Number System/04 UnaryOperator.java b/codes/Operators If-Else & Number System/04 UnaryOperator.java
deleted file mode 100644
index db12b59..0000000
--- a/codes/Operators If-Else & Number System/04 UnaryOperator.java
+++ /dev/null
@@ -1,37 +0,0 @@
-import java.util.Scanner;
-
-class UnaryOperator {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter the number: ");
- int a = input.nextInt();
-
- a++; // Post-increment
- System.out.println("After post-increment (a++), a ==> (" + a + ")");
- ++a; // Pre-increment
- System.out.println("After pre-increment (++a), a ==> (" + a + ")");
- a--; // Post-decrement
- System.out.println("After post-decrement (a--), a ==> (" + a + ")");
- --a; // Pre-decrement
- System.out.println("After pre-decrement (--a), a ==> (" + a + ")");
-
- // Difference between Post & Pre Increment/Decrement
- int postIncrement = a++; // Post-increment (This will assign the current value of a, then increment a)
- System.out.println("\n\nPost-increment (b = a++) ==> (b: " + postIncrement + ", a: " + a + ")");
- a--; // Decrementing a back to original for clarity
- int preIncrement = ++a; // Pre-increment (This will increment a first, then assign the new value to preIncrement)
- System.out.println("Pre-increment (c = ++a) ==> (c: " + preIncrement + ", a: " + a + ")");
- a--; // Decrementing a back to original for clarity
- int postDecrement = a--; // Post-decrement (This will assign the current value of a, then decrement a)
- System.out.println("Post-decrement (d = a--) ==> (d: " + postDecrement + ", a: " + a + ")");
- a++; // Incrementing a back to original for clarity
- int preDecrement = --a; // Pre-decrement (This will decrement a first, then assign the new value to preDecrement)
- System.out.println("Pre-decrement (e = --a) ==> (e: " + preDecrement + ", a: " + a + ")");
-
- int unaryPlus = +a; // Unary plus (This is redundant but included for demonstration | it doesn't change the value)
- System.out.println("\n\nUnary plus (+a) ==> (" + unaryPlus + ")"); // ==>
- int unaryMinus = -a; // Unary minus (This changes the sign of the value)
- System.out.println("Unary minus (-a) ==> (" + unaryMinus + ")"); // ==>
-
- }
-}
diff --git a/codes/Practice Questions/Swap two numbers without a third variable.java b/codes/Practice Questions/Swap two numbers without a third variable.java
deleted file mode 100644
index 371a878..0000000
--- a/codes/Practice Questions/Swap two numbers without a third variable.java
+++ /dev/null
@@ -1,24 +0,0 @@
-import java.util.Scanner;
-
-class SwapTwoVariableWithoutThirdVariable {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter first number: ");
- int firstNumber = input.nextInt();
- System.out.print("Enter second number: ");
- int secondNumber = input.nextInt();
-
- System.out.println("Before swapping: ");
- System.out.println("First number: " + firstNumber);
- System.out.println("Second number: " + secondNumber);
-
- // Swapping without a third variable
- firstNumber = firstNumber + secondNumber; // Step 1: Add both numbers
- secondNumber = firstNumber - secondNumber; // Step 2: Subtract new secondNumber from the sum to get the first number
- firstNumber = firstNumber - secondNumber; // Step 3: Subtract new firstNumber from the sum to get the second number
-
- System.out.println("After swapping: ");
- System.out.println("First number: " + firstNumber);
- System.out.println("Second number: " + secondNumber);
- }
-}
diff --git "a/codes/Practice Questions/Temperature converter: Celsius 342円206円224円 Fahrenheit.java" "b/codes/Practice Questions/Temperature converter: Celsius 342円206円224円 Fahrenheit.java"
deleted file mode 100644
index 0393b63..0000000
--- "a/codes/Practice Questions/Temperature converter: Celsius 342円206円224円 Fahrenheit.java"
+++ /dev/null
@@ -1,11 +0,0 @@
-import java.util.Scanner;
-
-class CelsiusToFahrenheit {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter temperature in Celsius: ");
- double celsius = input.nextDouble();
- double fahrenheit = (celsius * 9 / 5) + 32; // Conversion formula
- System.out.printf("%.2f Celsius is equal to %.2f Fahrenheit%n", celsius, fahrenheit);
- }
-}
diff --git a/docs/01_basics/01_introduction_to_java.md b/docs/01_basics/01_introduction_to_java.md
deleted file mode 100644
index 976779b..0000000
--- a/docs/01_basics/01_introduction_to_java.md
+++ /dev/null
@@ -1,234 +0,0 @@
-## Introduction to Java
-Java is a high-level, class-based, object-oriented programming language. It was originally developed by James Gosling and his team at Sun Microsystems in the early 1990s. Sun Microsystems released Java publicly in 1995, aiming to create a language that could run on any device, regardless of architecture. In 2010, Sun Microsystems was acquired by Oracle Corporation, which now maintains and develops Java.
-Java applications are typically compiled to `bytecode`, which can run on any Java Virtual Machine (JVM). This makes Java a "write once, run anywhere" (WORA) language, allowing developers to build cross-platform applications efficiently.
-
-### Why Learn Java?
-- **Platform Independence**: Java's ability to run on any device with a JVM makes it highly versatile.
-- **Object-Oriented**: Java's object-oriented nature promotes code reusability and modularity.
-- **Robust Standard Library**: Java comes with a comprehensive standard library that simplifies development.
-- **Strong Community Support**: Java has a large and active community, providing extensive resources and libraries.
-- **Enterprise Use**: Java is widely used in enterprise environments, making it a valuable skill for developers.
-- **Performance**: While not as fast as languages like C or C++, Java offers good performance for most applications due to its Just-In-Time (JIT) compiler.
-- **Security**: Java has built-in security features that help protect applications from various threats.
-- **Versatility**: Java is used in various domains, including web development, mobile applications (Android), enterprise software, and big data technologies.
-- **Job Opportunities**: Java developers are in high demand, with numerous job opportunities available worldwide.
-- **Continuous Evolution**: Java is continuously updated with new features and improvements, ensuring it remains relevant in the ever-evolving tech landscape.
-
-## What is a Programming Language?
-A programming language is a formal language comprising a set of instructions that produce various kinds of output. Programming languages are used in computer programming to implement algorithms and manipulate data structures. They provide a way for humans to communicate with computers and create software applications.
-### Programming languages can be classified into several categories, including:
-- **High-Level Languages**: These languages are closer to human languages and abstract away much of the complexity of the computer's hardware. Examples include Java, Python, and C++.
-- **Low-Level Languages**: These languages are closer to machine code and provide little abstraction from the computer's hardware. Examples include Assembly language and machine code.
-- **Compiled Languages**: These languages are translated into machine code by a compiler before execution. Examples include C and C++.
-- **Interpreted Languages**: These languages are executed line-by-line by an interpreter. Examples include Python and JavaScript.
-- **Scripting Languages**: These languages are often used for automating tasks and are typically interpreted. Examples include JavaScript, Perl, and Ruby.
-- **Object-Oriented Languages**: These languages are based on the concept of "objects," which can contain data and methods. Examples include Java, C++, and Python.
-- **Functional Languages**: These languages are based on mathematical functions and avoid changing state or mutable data. Examples include Haskell and Lisp.
-- **Procedural Languages**: These languages are based on the concept of procedure calls, where the program is structured as a sequence of instructions. Examples include C and Pascal.
-- **Markup Languages**: These languages are used to define the structure and presentation of text. Examples include HTML and XML.
-- **Domain-Specific Languages (DSLs)**: These languages are designed for specific application domains. Examples include SQL for database queries and CSS for styling web pages.
-
-## What is an Algorithm?
-An algorithm is a step-by-step procedure or set of rules designed to perform a specific task or solve a particular problem. Algorithms are fundamental to computer science and programming, as they provide a clear and systematic way to process data and achieve desired outcomes.
-
-### Key Characteristics of Algorithms:
-- **Input**: An algorithm takes zero or more inputs, which are the data or values that the algorithm processes.
-- **Output**: An algorithm produces one or more outputs, which are the results of the processing.
-- **Definiteness**: Each step of the algorithm must be clearly defined and unambiguous.
-- **Finiteness**: An algorithm must terminate after a finite number of steps.
-- **Effectiveness**: Each step of the algorithm must be basic enough to be performed, in principle, by a person using only pencil and paper.
-- **Generality**: An algorithm should be applicable to a class of problems, not just a specific instance.
-- **Efficiency**: Algorithms can be evaluated based on their time complexity (how fast they run) and space complexity (how much memory they use).
-- **Correctness**: An algorithm should produce the correct output for all valid inputs.
-- **Determinism**: For a given input, an algorithm should always produce the same output.
-- **Modularity**: Algorithms can often be broken down into smaller sub-algorithms or functions, making them easier to understand and maintain.
-- **Scalability**: A good algorithm should perform well even as the size of the input data increases.
-- **Adaptability**: Some algorithms can be adapted or modified to solve related problems or to improve performance.
-
-## What is Syntax?
-Syntax refers to the set of rules and conventions that define the structure and format of a programming language. It dictates how code must be written in order to be correctly interpreted and executed by a compiler or interpreter. Syntax includes the arrangement of keywords, operators, punctuation, and other elements that make up the language.
-
-### Key Aspects of Syntax:
-- **Keywords**: Reserved words that have special meaning in the programming language (e.g., `if`, `else`, `while` in Java).
-- **Operators**: Symbols that perform specific operations on data (e.g., `+`, `-`, `*`, `/`).
-- **Punctuation**: Characters that help structure the code (e.g., semicolons, parentheses, braces).
-- **Identifiers**: Names used to identify variables, functions, classes, and other entities in the code.
-- **Statements**: Complete instructions that perform a specific action (e.g., variable declarations, assignments, function calls).
-- **Expressions**: Combinations of variables, operators, and values that evaluate to a single value.
-- **Control Structures**: Constructs that control the flow of execution in the program (e.g., loops, conditionals).
-- **Data Types**: Definitions of the types of data that can be used in the program (e.g., integers, strings, booleans).
-- **Comments**: Non-executable text that provides explanations or notes within the code (e.g., `//` for single-line comments in Java).
-- **Whitespace**: Spaces, tabs, and newlines that help format the code for readability but are generally ignored by the compiler.
-- **Block Structure**: The way code is grouped into blocks, often using braces `{}` to define the beginning and end of functions, loops, and conditionals.
-- **Error Handling**: Syntax rules also define how errors are reported and handled during code execution.
-
-Understanding and adhering to the syntax of a programming language is crucial for writing valid and functional code. Each programming language has its own unique syntax, so learning the specific rules of the language you are working with is essential for effective programming.
-
-## What is Semantics?
-Semantics refers to the meaning and interpretation of the elements and constructs within a programming language. While syntax defines the structure and format of the code, semantics focuses on what the code actually does when executed. It encompasses the rules that govern how the various components of the language interact and the effects they produce.
-
-### Key Aspects of Semantics:
-- **Behavior**: Semantics defines how different constructs behave during execution, such as how variables are assigned values, how functions are called, and how control structures (like loops and conditionals) operate.
-- **Data Types**: Semantics includes the rules for how different data types interact, such as type conversion, type checking, and operations that can be performed on specific types.
-- **Scope and Lifetime**: Semantics defines the scope (visibility) and lifetime (duration) of variables and other entities in the program.
-- **Functionality**: Semantics describes the intended functionality of various constructs, such as what a specific function is supposed to do when called.
-- **Error Handling**: Semantics includes the rules for how errors are detected and handled during program execution.
-- **Side Effects**: Semantics considers the side effects of operations, such as changes to global state or modifications to data structures.
-- **Control Flow**: Semantics defines how control flows through the program, including the order of execution for statements and the conditions under which certain blocks of code are executed.
-- **Evaluation**: Semantics includes the rules for evaluating expressions, determining the results of operations, and resolving references to variables and functions.
-- **Concurrency**: In languages that support concurrent programming, semantics defines how multiple threads or processes interact and share resources.
-- **Memory Management**: Semantics may also cover how memory is allocated, accessed, and deallocated during program execution.
-Understanding the semantics of a programming language is essential for writing correct and efficient code. It helps developers
-
-## History of Java
-Java was created in the early 1990s by James Gosling and his team at Sun Microsystems. The project was initially called "Oak" but was later renamed to "Java" after a type of coffee. The language was designed to be platform-independent, allowing developers to write code that could run on any device with a Java Virtual Machine (JVM). Java was officially released to the public in 1995, and it quickly gained popularity due to its "write once, run anywhere" (WORA) capability. Over the years, Java has undergone several updates and improvements, with major versions being released periodically. In 2010, Sun Microsystems was acquired by Oracle Corporation, which now maintains and develops Java. Today, Java remains one of the most widely used programming languages in the world, particularly in enterprise environments, web development, and Android app development. to understand how their code will behave and to anticipate potential issues that may arise during execution.
-
-### Key Milestones in Java's History:
-- **1991**: The Java project, initially called "Oak," was started by James Gosling and his team at Sun Microsystems.
-- **1995**: Java 1.0 was officially released to the public, introducing the concept of "write once, run anywhere" (WORA).
-- **1996**: Java 1.1 was released, adding features such as inner classes, JavaBeans, and JDBC (Java Database Connectivity).
-- **1998**: Java 1.2, also known as Java 2, was released, introducing the Swing GUI toolkit and the Collections Framework.
-- **2000**: Java 1.3 was released, focusing on performance improvements and new features like the Java Naming and Directory Interface (JNDI).
-- **2002**: Java 1.4 was released, adding features such as assertions, regular expressions, and the NIO (New I/O) package.
-- **2004**: Java 5 (also known as Java 1.5) was released, introducing major features like generics, annotations, and the enhanced for loop.
-- **2006**: Java 6 was released, focusing on performance improvements, scripting support, and web services.
-- **2011**: Java 7 was released, adding features like the try-with-resources statement, the diamond operator, and the NIO.2 file system API.
-- **2014**: Java 8 was released, introducing significant features such as lambda expressions, the Stream API, and the new Date and Time API.
-- **2017**: Java 9 was released, bringing the module system (Project Jigsaw), JShell (the interactive REPL), and other enhancements.
-- **2018**: Java 10 was released, introducing local variable type inference with the `var` keyword.
-- **2018**: Java 11 was released as a Long-Term Support (LTS) version, adding features like the HTTP Client API and various performance improvements.
-- **2019**: Java 12 was released, introducing features like switch expressions (preview) and JVM constants API.
-- **2020**: Java 14 was released, adding features like records (preview) and pattern matching for `instanceof` (preview).
-- **2021**: Java 16 was released, introducing features like records and pattern matching for `instanceof` as standard features.
-- **2021**: Java 17 was released as an LTS version, bringing features like sealed classes and enhanced pseudo-random number generators.
-- **2022**: Java 18 was released, adding features like simple web server and code snippets in Java API documentation.
-- **2023**: Java 19 was released, introducing features like virtual threads (preview) and structured concurrency (preview).
-- **2024**: Java 20 was released, continuing to build on previous features and improvements, with a focus on performance and developer productivity.
-- **Future Plans**: Java continues to evolve with regular releases every six months, with ongoing development focused on enhancing performance, security, and developer experience.
-
-## Magic of Bytecode
-Java's "write once, run anywhere" (WORA) capability is made possible through the use of bytecode. When a Java program is compiled, the source code is transformed into an intermediate form known as bytecode. This bytecode is platform-independent, meaning it can be executed on any device that has a Java Virtual Machine (JVM) installed. The JVM interprets the bytecode and translates it into machine code that is specific to the underlying hardware and operating system. This allows Java applications to run seamlessly across different platforms without the need for recompilation. The use of bytecode not only enhances portability but also provides a layer of security and performance optimization through Just-In-Time (JIT) compilation, which compiles bytecode into native machine code at runtime for improved execution speed.
-
-### How Bytecode Works:
-1. **Compilation**: When a Java program is written, it is saved in a file with a `.java` extension. The Java compiler (`javac`) takes this source code and compiles it into bytecode, which is saved in a file with a `.class` extension.
-2. **Platform Independence**: The generated bytecode is platform-independent, meaning it can be executed on any device that has a compatible JVM. This is a key feature of Java, allowing developers to write code once and run it anywhere.
-3. **Java Virtual Machine (JVM)**: The JVM is a crucial component of the Java platform. It is responsible for loading, verifying, and executing the bytecode. Each platform (Windows, macOS, Linux, etc.) has its own implementation of the JVM, which ensures that the same bytecode can run on different systems.
-4. **Interpretation and Execution**: When a Java program is executed, the JVM reads the bytecode and interprets it. The JVM translates the bytecode into machine code that is specific to the host system, allowing the program to run.
-
-### Advantages of Bytecode:
-- **Portability**: Bytecode can run on any platform with a compatible JVM, making Java applications highly portable.
-- **Security**: The JVM provides a secure execution environment, with features like bytecode verification to prevent malicious code from causing harm.
-- **Performance**: The JVM uses Just-In-Time (JIT) compilation to convert bytecode into native machine code at runtime, improving performance.
-- **Optimization**: The JVM can optimize bytecode execution based on the specific characteristics of the host system.
-- **Interoperability**: Bytecode allows Java to interoperate with other languages that can also compile to bytecode, such as Kotlin and Scala.
-- **Dynamic Loading**: The JVM can load classes dynamically at runtime, allowing for features like reflection and dynamic proxies.
-- **Memory Management**: The JVM handles memory management through garbage collection, reducing the risk of memory leaks and other memory-related issues.
-- **Rich Ecosystem**: The use of bytecode enables a rich ecosystem of libraries and frameworks that can be used across different platforms.
-- **Backward Compatibility**: Java maintains backward compatibility, allowing older bytecode to run on newer versions of the JVM without modification.
-- **Cross-Language Support**: Bytecode allows for the development of languages other than Java that can run on the JVM, expanding the ecosystem and providing more options for developers.
-
-### Example of Bytecode:
-Here is a simple Java program and its corresponding bytecode:
-```java
-// Java Source Code (HelloWorld.java)
-public class HelloWorld {
- public static void main(String[] args) {
- System.out.println("Hello, World! ==> ");
- }
-}
-```
-When compiled, this code generates a `HelloWorld.class` file containing the following bytecode (simplified representation):
-```// Bytecode (HelloWorld.class)
-0: ldc #2 // String "Hello, World! ==> "
-3: invokevirtual #3 // Method java/io/PrintStream.println:(Ljava/lang/String;)V
-6: return
-```
-This bytecode can be executed on any platform with a compatible JVM, demonstrating Java's portability and the magic of bytecode.
-
-## How Java Works
-Java works through a combination of compilation and interpretation, utilizing the Java Virtual Machine (JVM) to execute code across different platforms. Here’s a step-by-step overview of how Java works:
-1. **Writing the Code**: A developer writes Java source code in a file with a `.java` extension using a text editor or an Integrated Development Environment (IDE).
-2. **Compilation**: The Java compiler (`javac`) takes the source code and compiles it into bytecode, which is saved in a file with a `.class` extension. This bytecode is platform-independent.
-3. **Loading the Bytecode**: When the Java program is executed, the JVM loads the bytecode from the `.class` file.
-4. **Bytecode Verification**: The JVM verifies the bytecode to ensure it adheres to Java's security and integrity constraints, preventing malicious code from executing.
-5. **Execution**: The JVM interprets the bytecode and translates it into machine code specific to the host system. This is done using an interpreter or Just-In-Time (JIT) compilation, which compiles bytecode into native machine code at runtime for improved performance.
-6. **Runtime Environment**: The JVM provides a runtime environment that includes memory management, garbage collection, and other services necessary for executing Java applications.
-7. **Output**: The program produces output based on the instructions defined in the source code, such as printing text to the console or interacting with files and databases.
-8. **Cross-Platform Execution**: Since the bytecode is platform-independent, the same `.class` file can be executed on any device with a compatible JVM, achieving Java's "write once, run anywhere" (WORA) capability.
-
-### Key Components of How Java Works:
-- **Java Compiler (`javac`)**: Converts Java source code into bytecode.
-- **Java Virtual Machine (JVM)**: Executes the bytecode and provides a platform-independent runtime environment.
-- **Java Runtime Environment (JRE)**: A package that includes the JVM and standard libraries needed to run Java applications.
-- **Java Development Kit (JDK)**: A package that includes the JRE, compiler, and other tools for developing Java applications.
-- **Class Loader**: A part of the JVM that loads classes into memory when they are needed.
-- **Garbage Collector**: A part of the JVM that automatically manages memory by reclaiming memory occupied by objects that are no longer in use.
-- **Just-In-Time (JIT) Compiler**: A component of the JVM that improves performance by compiling bytecode into native machine code at runtime.
-- **Standard Libraries**: A collection of pre-written classes and methods that provide functionality for tasks such as data manipulation, networking, and user interface development.
-- **Platform Independence**: The ability to run the same bytecode on different operating systems and hardware architectures without modification.
-- **Security Features**: Built-in security mechanisms that protect against unauthorized access and ensure safe execution of code.
-- **Performance Optimization**: Techniques used by the JVM to enhance the performance of Java applications, such as adaptive optimization and inlining.
-- **Multithreading Support**: Java provides built-in support for multithreading, allowing concurrent execution of multiple threads within a program.
-- **Exception Handling**: Java includes a robust exception handling mechanism to manage runtime errors and maintain program stability.
-- **Rich Ecosystem**: Java has a vast ecosystem of libraries, frameworks, and tools that support various application domains, from web development to big data and mobile applications.
-- **Community Support**: Java has a large and active community that contributes to its development, provides support, and shares knowledge through forums, tutorials, and open-source projects.
-
-## How Java Changed the Internet
-Java revolutionized the internet by enabling the development of dynamic, interactive, and platform-independent web applications. Before Java, web content was primarily static, consisting of simple HTML pages. Java introduced the ability to create applets—small applications that could run within a web browser, providing rich user experiences and interactive features. This capability allowed developers to build complex applications that could be accessed from any device with a compatible JVM, regardless of the underlying operating system. Java's "write once, run anywhere" (WORA) principle made it easier to deploy applications across different platforms, fostering the growth of web-based services and e-commerce. Additionally, Java's robust security features helped establish trust in online transactions, further driving the adoption of internet technologies. Over time, Java evolved to support server-side development through technologies like JavaServer Pages (JSP) and servlets, enabling the creation of scalable and secure web applications. Overall, Java played a pivotal role in shaping the modern internet by providing the tools and capabilities needed to build sophisticated web applications.
-
-### Key Contributions of Java to the Internet:
-1. **Applets**: Java applets allowed developers to create interactive applications that could run within web browsers, enhancing user engagement and experience.
-2. **Platform Independence**: Java's ability to run on any device with a JVM made it easier to deploy web applications across different platforms, promoting accessibility and reach.
-3. **Security**: Java's built-in security features, such as the sandbox model, helped protect users from malicious code, fostering trust in online applications and transactions.
-4. **Server-Side Development**: Java introduced technologies like JavaServer Pages (JSP) and servlets, enabling the development of dynamic, server-side web applications that could handle complex business logic and data processing.
-5. **Enterprise Applications**: Java's robust ecosystem and frameworks, such as Spring and Hibernate, facilitated the development of large-scale enterprise applications that could be accessed over the internet.
-6. **E-Commerce**: Java played a significant role in the growth of e-commerce by providing secure and scalable solutions for online shopping platforms.
-7. **Web Services**: Java supported the development of web services, allowing different applications to communicate over the internet using standard protocols like SOAP and REST.
-8. **Rich User Interfaces**: Java's Swing and JavaFX libraries enabled the creation of rich user interfaces for web applications, improving usability and aesthetics.
-9. **Mobile Applications**: Java's influence extended to mobile development, particularly with the rise of Android, which uses Java as its primary programming language.
-10. **Community and Ecosystem**: Java's large and active community contributed to the development of numerous libraries, frameworks, and tools that supported web development.
-11. **Scalability**: Java's architecture allowed for the creation of scalable web applications that could handle increasing user loads and data volumes.
-12. **Integration**: Java facilitated the integration of web applications with databases, third-party services, and other systems, enhancing functionality and interoperability.
-13. **Continuous Evolution**: Java has continuously evolved to meet the changing needs of web development, with regular updates introducing new features and improvements.
-14. **Cloud Computing**: Java has become a popular choice for developing cloud-based applications, leveraging its scalability and robustness in distributed environments.
-15. **Microservices Architecture**: Java has been widely adopted for building microservices, allowing developers to create modular and independently deployable services that can communicate over the internet.
-16. **Big Data and Analytics**: Java has played a significant role in the big data ecosystem, with frameworks like Apache Hadoop and Apache Spark being built using Java, enabling the processing and analysis of large datasets over the internet.
-17. **Internet of Things (IoT)**: Java's platform independence and robustness have made it a popular choice for developing IoT applications, allowing devices to connect and communicate over the internet.
-18. **APIs and SDKs**: Java has been used to create numerous APIs and SDKs that facilitate the development of web applications and services, providing developers with tools to build and integrate functionality easily.
-19. **Content Management Systems (CMS)**: Java has been used to develop various CMS platforms, enabling users to create, manage, and publish web content efficiently.
-20. **Social Media Platforms**: Java has been utilized in the development of social media platforms, providing the backend infrastructure needed to support large user bases and real-time interactions.
-21. **Educational Resources**: Java has been widely adopted in educational institutions for teaching programming and web development, contributing to the growth of skilled developers in the internet ecosystem.
-22. **Open Source Contributions**: The open-source nature of Java has led to numerous contributions from the community, resulting in a rich ecosystem of libraries and frameworks that support web development.
-23. **Performance Optimization**: Java's performance optimization techniques, such as Just-In-Time (JIT) compilation, have improved the speed and efficiency of web applications, enhancing user experience.
-24. **Cross-Browser Compatibility**: Java applets and web applications built with Java have been designed to work across different web browsers, ensuring a consistent experience for users regardless of their choice of browser.
-25. **Development Tools**: Java has a wide range of development tools and IDEs (e.g., Eclipse, IntelliJ IDEA, NetBeans) that facilitate the development, testing, and deployment of web applications, improving developer productivity.
-26. **Frameworks and Libraries**: Java has a rich ecosystem of frameworks and libraries (e.g., Spring, Hibernate, Struts) that simplify web development, providing pre-built components and functionalities that accelerate the development process.
-27. **Community Support**: Java has a large and active community of developers who contribute to forums, share knowledge, and provide support, fostering collaboration and innovation in web development.
-28. **Documentation and Learning Resources**: Java has extensive documentation and learning resources available, making it easier for developers to learn and master web development using Java.
-29. **Global Adoption**: Java has been widely adopted by organizations and developers worldwide, contributing to its influence on the internet and web development.
-30. **Standardization**: Java has established itself as a standard programming language for web development, with many organizations adopting it for their web applications and services.
-
-
-## Java Buzzwords
-Java is often associated with several buzzwords that highlight its key features and advantages. Here are some of the most common Java buzzwords:
-1. **Platform Independence**: Java's ability to run on any device with a Java Virtual Machine (JVM) makes it platform-independent, allowing developers to write code once and run it anywhere.
-2. **Object-Oriented**: Java is an object-oriented programming language, promoting code reusability, modularity, and maintainability through the use of classes and objects.
-3. **Simple**: Java is designed to be easy to learn and use, with a syntax that is straightforward and similar to other popular programming languages like C and C++.
-4. **Secure**: Java has built-in security features, such as the sandbox model and bytecode verification, that help protect applications from malicious code and unauthorized access.
-5. **Robust**: Java emphasizes reliability and stability, with features like strong type checking, exception handling, and automatic memory management (garbage collection) that help prevent common programming errors.
-
-## Object-Oriented Programming (OOP) Concepts in Java
-Java is a fully object-oriented programming language, which means it is based on the principles of object-oriented programming (OOP). OOP is a programming paradigm that uses "objects" to represent data and behavior.
-
-### Here are the key OOP concepts in Java:
-1. **Class**: A class is a blueprint or template for creating objects. It defines the properties (attributes) and behaviors (methods) that the objects created from the class will have.
-2. **Object**: An object is an instance of a class. It represents a specific entity with its own state and behavior, as defined by the class.
-3. **Encapsulation**: Encapsulation is the principle of bundling data (attributes) and methods (functions) that operate on that data within a single unit (class). It restricts direct access to some of the object's components, promoting data hiding and protecting the integrity of the object's state.
-4. **Inheritance**: Inheritance is a mechanism that allows a new class (subclass) to inherit properties and behaviors from an existing class (superclass). This promotes code reusability and establishes a hierarchical relationship between classes.
-5. **Polymorphism**: Polymorphism allows objects of different classes to be treated as objects of a common superclass. It enables a single interface to represent different underlying forms (data types). In Java, polymorphism is achieved through method overriding and method overloading.
-6. **Abstraction**: Abstraction is the concept of simplifying complex systems by modeling classes based on the essential properties and behaviors an object should have, while ignoring irrelevant details. In Java, abstraction is achieved through abstract classes and interfaces.
-7. **Method Overriding**: Method overriding is a feature that allows a subclass to provide a specific implementation of a method that is already defined in its superclass. This enables runtime polymorphism.
-8. **Method Overloading**: Method overloading is a feature that allows multiple methods in the same class to have the same name but different parameter lists. This enables compile-time polymorphism.
-9. **Constructor**: A constructor is a special method that is called when an object is instantiated. It is used to initialize the object's attributes.
-10. **Interface**: An interface is a reference type in Java that defines a contract of methods that a class must implement. It allows for multiple inheritance of type and promotes loose coupling between classes.
-
diff --git a/docs/01_basics/02_syntax_of_java.md b/docs/01_basics/02_syntax_of_java.md
deleted file mode 100644
index 71d9eb8..0000000
--- a/docs/01_basics/02_syntax_of_java.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# Syntax Of Java
-
-Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation
-dependencies as possible. Here are some of the key syntax elements of Java:
-
-1. **Class Declaration**: Every Java application must have at least one class definition that contains the `main`
- method.
- ```java
- public class MyClass {
- // class body ==>
- }
- ```
-2. **Main Method**: The entry point of any Java application is the `main` method.
- ```java
- public static void main(String[] args) {
- // code to be executed ted ==>
- }
- ```
-3. **Variables**: Variables must be declared with a specific data type before they can be used.
- ```java
- int myNumber = 5; // integer variable
- String myString = "Hello, World! test ==> "; // string variable
- ```
-4. **Data Types**: Java has several built-in data types, including:
- - Primitive types: `int`, `byte`, `short`, `long`, `float
- - , `double`, `char`, `boolean`
- - Non-primitive types: `String`, `Arrays`, `Classes`, etc.
-5. **Control Structures**: Java supports various control structures such as:
- - Conditional statements: `if`, `else if`, `else`, `switch`
- - Loops: `for`, `while`, `do-while`
- ```java
- if (myNumber> 0) {
- System.out.println("Positive number ==> ");
- } else {
- System.out.println("Non-positive number ==> ");
- }
- ```
-6. **Methods**: Methods are blocks of code that perform a specific task and can be called from other parts of the
- program.
- ```java
- public int add(int a, int b) {
- return a + b;
- }
- ```
-7. **Comments**: Java supports single-line (`//`) and multi-line (`/* ... */`) comments.
-8. **Packages**: Java uses packages to group related classes and interfaces.
- ```java
- package com.example.myapp;
- ```
-9. **Import Statements**: To use classes from other packages, you need to import them
-10. **Exception Handling**: Java provides a robust exception handling mechanism using `try`, `catch`, `finally`, and
- `throw` keywords.
- ```java
- try {
- // code that may throw an exception
- } catch (ExceptionType e) {
- // handle exception ==>
- } finally {
- // code that will always execute
- }
- ```
diff --git a/docs/01_basics/03_java_basics.md b/docs/01_basics/03_java_basics.md
deleted file mode 100644
index 0af5208..0000000
--- a/docs/01_basics/03_java_basics.md
+++ /dev/null
@@ -1,121 +0,0 @@
-# Basics of Java Programming
-
-Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation
-dependencies as possible. It is widely used for building enterprise-scale applications, mobile applications (especially
-Android apps), web applications, and more.
-
-# Installing Java Development Kit (JDK)
-
-To start programming in Java, you need to install the Java Development Kit (JDK) on your machine. You can download the
-latest version of JDK from the official Oracle website or use an open-source alternative like OpenJDK.
-
-# Setting Up Your Development Environment
-
-You can write Java code using any text editor, but it's recommended to use an Integrated Development Environment (IDE)
-like IntelliJ IDEA, Eclipse, or NetBeans for better productivity. These IDEs provide features like code completion,
-debugging, and project management.
-
-# Writing First Java Program
-
-Here is a simple Java program that prints "Jai Shri Ram!" to the console:
-
-```java
-public class JaiShriRam {
- public static void main(String[] args) {
- System.out.println("Jai Shri Ram! || Jai Hanuman!");
- }
-}
-```
-
-# Compiling and Running Java Program
-
-To compile and run the Java program, follow these steps:
-
-1. Save the code in a file named `JaiShriRam.java`.
-2. Open a terminal or command prompt and navigate to the directory where the file is saved.
-3. Compile the program using the following command:
-4. ```bash
- javac JaiShriRam.java
- ```
-5. This will create a file named `JaiShriRam.class` in the same directory.
-6. Run the program using the following command:
-7. ```bash
- java JaiShriRam
- ```
-8. You should see the output:
-9. ```
- Jai Shri Ram!
- ```
-
-# Anatomy of a Class
-
-In Java, every application must have at least one class definition that contains the `main` method. Here is a breakdown
-of the components of a Java class:
-
-```java
-public class MyClass {
- // class body
- public static void main(String[] args) {
- // code to be executed
- }
-}
-```
-
-- `public`: Access modifier that allows the class to be accessible from other classes.
-- `class`: Keyword used to declare a class.
-- `MyClass`: Name of the class (should start with an uppercase letter).
-- `static`: Indicates that the method belongs to the class rather than an instance of the class.
-- `void`: Indicates that the method does not return any value.
-- `main`: Name of the method that serves as the entry point of the application.
-- `String[] args`: Parameter that allows the program to accept command-line arguments.
-- `{}`: Curly braces that define the body of the class and method.
-
-# File Extensions
-
-Java source files have the `.java` extension, while compiled bytecode files have the `.class` extension.
-
-# Differences Between JDK, JRE, and JVM
-
-- **JDK (Java Development Kit)**: A software development kit that includes tools for developing, compiling, and
- debugging Java applications. It contains the JRE and development tools like the Java compiler (`javac`).
-- **JRE (Java Runtime Environment)**: A package that provides the libraries, Java Virtual Machine (JVM), and other
- components
- necessary to run Java applications. It does not include development tools.
-- **JVM (Java Virtual Machine)**: An abstract machine that enables a computer to run Java programs. It interprets
- compiled Java bytecode and
- executes it on the host machine.
-
-# Showing Output
-
-To display output in Java, you can use the `System.out.println()` method. This method prints the specified message to
-the console and
-moves the cursor to a new line. For example:
-
-```java
- System.out.println("Hello, World! ==> ");
-```
-
-# Importance of the main method
-
-The `main` method is the entry point of any Java application. When you run a Java program, the Java Virtual Machine (
-JVM) looks for the `main` method to start executing
-the program. Without the `main` method, the program will not run.
-
-```java
- public static void main(String[] args) {
- // code to be executed ==>
-}
-```
-
-# Installing IDE(IntelliJ IDEA)
-
-To install IntelliJ IDEA, follow these steps:
-
-1. Go to the official IntelliJ IDEA website: https://www.jetbrains.com/idea/download
-2. Choose the appropriate version for your operating system (Windows, macOS, or Linux).
-3. Download the installer and run it.
-4. Follow the installation instructions provided by the installer.
-5. Once installed, launch IntelliJ IDEA and set up a new Java project.
-
-Thanks for reading!
-
diff --git a/docs/01_basics/04_java_basics_practice.md b/docs/01_basics/04_java_basics_practice.md
deleted file mode 100644
index 1129bbf..0000000
--- a/docs/01_basics/04_java_basics_practice.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# Java Basics Practice
-
-- Computers understand high level languages like Java, C.
-> **Answer:** False. Computers understand machine code; high-level languages need to be compiled or interpreted.
-
->>>>
-- An Algorithm is a set of instructions to accomplish a task.
-> **Answer:** True
-
-- Computer is smart enough to ignore incorrect syntax.
-> **Answer:** False. Incorrect syntax causes compilation errors.
-
-- Java was first released in 1992.
-> **Answer:** False. Java was first released in 1995.
-
-- Java was named over a person who made good coffee.
-> **Answer:** False. Java was named after Java coffee.
-
-- ByteCode is platform independent.
-> **Answer:** True
-
-- JDK is a part of JRE.
-> **Answer:** False. JRE is a part of JDK.
-
-- It’s optional to declare main method as public.
-> **Answer:** False. The main method must be public to be accessible by the JVM.
-
-- .class file contains machine code.
-> **Answer:** False. It contains bytecode, not machine code.
-
-- println adds a new line at the end of the line.
-> **Answer:** True