diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/java-backend-bootcamp-fork.iml b/.idea/java-backend-bootcamp-fork.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/.idea/java-backend-bootcamp-fork.iml
@@ -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..432b646
--- /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..a91dbf0
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ 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/session-02-big-picture/student-notes-repos.md b/session-02-big-picture/student-notes-repos.md
index a57c910..7750557 100644
--- a/session-02-big-picture/student-notes-repos.md
+++ b/session-02-big-picture/student-notes-repos.md
@@ -21,3 +21,4 @@
- https://github.com/Raj04/Spring-Bootcamp
- https://github.com/shawchandankumar/Java-Backend-Development
- https://github.com/bogdanbilcan/JavaBrains-BootCampNotes
+- https://github.com/sahilpandith/java-backend-bootcamp/blob/main/README.md
diff --git a/session-03-java-basics/.idea/.gitignore b/session-03-java-basics/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/session-03-java-basics/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/session-03-java-basics/.idea/misc.xml b/session-03-java-basics/.idea/misc.xml
new file mode 100644
index 0000000..432b646
--- /dev/null
+++ b/session-03-java-basics/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/session-03-java-basics/.idea/modules.xml b/session-03-java-basics/.idea/modules.xml
new file mode 100644
index 0000000..22b7f7e
--- /dev/null
+++ b/session-03-java-basics/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/session-03-java-basics/.idea/session-03-java-basics.iml b/session-03-java-basics/.idea/session-03-java-basics.iml
new file mode 100644
index 0000000..d6ebd48
--- /dev/null
+++ b/session-03-java-basics/.idea/session-03-java-basics.iml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/session-03-java-basics/.idea/vcs.xml b/session-03-java-basics/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/session-03-java-basics/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/session-03-java-basics/README.md b/session-03-java-basics/README.md
index c6516bc..31b0352 100644
--- a/session-03-java-basics/README.md
+++ b/session-03-java-basics/README.md
@@ -3,6 +3,29 @@
## Contents
### Basic Syntax:
Explains the basic syntax of the Java programming language, including how to declare variables, use control structures, and perform input/output operations.
+
+public class Main {
+ public static void main(String[] args){
+ //variable declaration
+ int i =0;
+ String s = "str";
+
+ if(i==0) {
+ System.out.println(i)
+ }
+ }
+}
+There are two types of variable declaration in java
+ 1) Primitives : These are immutable.
+ 1. int
+ 2. double
+ 3. float
+ 4. long
+ 5. boolean
+ 6. short
+ 7. byte
+ 8. chat
+
### Data Types:
Explains the different data types in Java, including primitive types (such as int, double, and boolean) and non-primitive types (such as Strings).
### Operators:
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/A.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/A.java
new file mode 100644
index 0000000..f48ae3e
--- /dev/null
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/A.java
@@ -0,0 +1,10 @@
+package io.javabrains.javabasics;
+
+public class A {
+ String var = "string";
+ private String privateVar = "privateString";
+ protected String protectedVar = "protectedString";
+
+ public String publicVar = "publicString";
+
+}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/AnonymousInnerClasses.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/AnonymousInnerClasses.java
index cc3de0b..c50b58d 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/AnonymousInnerClasses.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/AnonymousInnerClasses.java
@@ -5,8 +5,29 @@
Create an anonymous inner class implementation of `Animal2` and then call the `makeSound` method
*/
+abstract class Animal2{
+ abstract void makesound();
+}
public class AnonymousInnerClasses {
public static void main(String[] args) {
+ Animal2 cat = new Animal2(){
+ @Override
+ public void makesound(){
+ System.out.println("meow");
+
+ }
+ };
+ cat.makesound();
+
+ Animal2 dog = new Animal2(){
+ @Override
+ public void makesound(){
+ System.out.println("bow");
+
+ }
+ };
+ dog.makesound();
+
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ArrayChallenge.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ArrayChallenge.java
index 206699d..948c381 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ArrayChallenge.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ArrayChallenge.java
@@ -1,12 +1,31 @@
package io.javabrains.javabasics;
+import java.util.Arrays;
+
public class ArrayChallenge {
public static void main(String[] args) {
// Step 1: Create an array of integers
-
+ int[] arr = {10,20,33,10};
// Step 2: Use arrays and array operations to find the sum, average, and largest number in the array
+ int sum = 0;
+ double avg;
+ int largest =arr[0];
+ for (int i :arr){
+ sum+=i;
+ if(i>largest){
+ largest =i;
+ }
+ }
+ avg = sum / arr.length;
+ System.out.println("sum = " + sum);
+ System.out.println("avg = " + avg);
+ System.out.println("largest = " + largest);
+ int[] arrCopy = new int[3] ;
+ System.arraycopy(arr,1,arrCopy,0,3);
+ System.out.println("arrCopy = " + Arrays.toString(arrCopy));
+ System.out.println("arr = " + Arrays.toString(arr));
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/Assigments.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/Assigments.java
new file mode 100644
index 0000000..7705d86
--- /dev/null
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/Assigments.java
@@ -0,0 +1,159 @@
+package io.javabrains.javabasics;
+
+import org.w3c.dom.css.Rect;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Scanner;
+
+
+public class Assigments {
+
+ public static void main(String[] args) throws IOException {
+
+ // Assignment1
+ Scanner scanner = new Scanner(System.in);
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
+
+//
+// System.out.println("Enter first number");
+// double num1 = Double.parseDouble(scanner.nextLine());
+//
+// System.out.println("Enter second number");
+// double num2 = Double.parseDouble(bufferedReader.readLine());
+//
+//
+// System.out.println("sum " + (num1+num2));
+// System.out.println("sub " + (num1-num2));
+// System.out.println("product " + (num1*num2));
+// System.out.println("quotient " + (num1/num2));
+//
+//
+// //assognemtn2
+//
+// System.out.println("Enter name");
+// String name = scanner.nextLine();
+// System.out.println("Enter age");
+// int age = Integer.parseInt(bufferedReader.readLine());
+// System.out.println("Enter salary");
+// double salary = Double.parseDouble(scanner.nextLine());
+//
+// System.out.println("name = " + name);
+// System.out.println("age = " + age);
+// System.out.println("salary = " + salary);
+//
+//
+// //assignemt 3
+//
+// if(num1==0){
+// System.out.println("zero");
+// }else if (num1>0){
+// System.out.println("positive");
+// }else {
+// System.out.println("negative");
+// }
+//
+//
+// //Assignent 4
+// System.out.println("enter the size of array");
+// int length = Integer.parseInt(scanner.nextLine());
+//
+// ArrayList list = new ArrayList();
+//// Integer[] list = {};
+// for (int i =0; i vowels = new ArrayList<>();
+// vowels.add('a');
+// vowels.add('e');
+// vowels.add('i');
+// vowels.add('o');
+// vowels.add('u');
+// int count=0;
+// for(char c : str.toCharArray()){
+// if(vowels.contains(Character.toLowerCase(c))){
+// count++;
+// }
+// }
+//
+// System.out.println("count = " + count);
+//
+//
+// scanner.close();
+// bufferedReader.close();
+//
+
+ // Assignment 6
+ Rectangle1 rect = new Rectangle1(12,23);
+ System.out.println(rect.calculateArea());
+
+ //Assignment 6
+ Animal1 loin = new Lion1("timothy",178,21);
+ Animal1 cow = new Cow("jersey",154,20);
+
+ loin.feed();;
+ cow.feed();
+ }
+}
+
+class Rectangle1{
+ int height;
+ int width;
+ Rectangle1(int height,int width){
+ this.height = height;
+ this.width = width;
+ }
+
+ public int calculateArea(){
+ return this.height* this.width;
+ }
+}
+
+class Animal1 {
+ String name;
+ double weight;
+ int age;
+ Animal1(String name,double weight,int age){
+ this.name = name;
+ this.weight = weight;
+ this.age = age;
+ }
+ public void feed(){
+ System.out.println("Animal eats food");
+ }
+}
+
+class Lion1 extends Animal1{
+ Lion1(String name,double weight, int age){
+ super(name,weight,age);
+ }
+ public void feed(){
+ System.out.println("Loin eats meat");
+ }
+
+}
+
+class Cow extends Animal1{
+ Cow(String name,double weight, int age){
+ super(name,weight,age);
+ }
+ public void feed(){
+ System.out.println("Cow eats grass");
+ }
+
+
+}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/B.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/B.java
new file mode 100644
index 0000000..476fbb2
--- /dev/null
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/B.java
@@ -0,0 +1,17 @@
+package io.javabrains.javabasics;
+
+class B {
+ public void accessVars(){
+ A a = new A();
+// System.out.println("a.privateVar = " + a.privateVar); // can't perform this since it is private var
+ System.out.println("a.var = " + a.var);
+ System.out.println("a.protectedVar = " + a.protectedVar);
+ System.out.println("a.publicVar = " + a.publicVar);
+ }
+ public static void main(String[] args) {
+ B b = new B();
+ b.accessVars();
+ }
+}
+
+
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ClassesAndObjects.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ClassesAndObjects.java
index a4d18d7..26f41c7 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ClassesAndObjects.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ClassesAndObjects.java
@@ -18,9 +18,49 @@
*/
+class Car{
+ String make;
+ String model;
+ int year;
+ Car(String make, String model,int year){
+ this.make = make;
+ this.model = model;
+ this.year = year;
+ }
+
+ public String getMake(){
+ return make;
+ }
+ public String getModel(){
+ return model;
+ }
+ public int getYear() {
+ return year;
+ }
+
+ public void setYear(int year) {
+ this.year = year;
+ }
+
+ public void setMake(String make) {
+ this.make = make;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public String toString(){
+ return year + " " + make + " " + model;
+ }
+}
public class ClassesAndObjects {
public static void main(String[] args) {
-
+ Car car = new Car("Tata", "Nexon", 2024);
+ System.out.println("make = " + car.make);
+ System.out.println("model = " + car.model);
+ System.out.println("year = " + car.year);
+ System.out.println("Details : " + car.toString());
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/InheritanceChallenge.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/InheritanceChallenge.java
index a2a4f17..9aeb27b 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/InheritanceChallenge.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/InheritanceChallenge.java
@@ -12,9 +12,52 @@
*/
+class Animal{
+ String name;
+ int age;
+ Animal(String name,int age){
+ this.name = name;
+ this.age = age;
+ }
+
+ public String makeSound(){
+ return "make sound";
+ }
+}
+class Dog extends Animal{
+ String breed;
+ Dog(String name, int age, String breed) {
+ super(name, age);
+ this.breed = breed;
+ }
+
+ @Override
+ public String makeSound(){
+ return "The Dog Barks";
+ }
+}
+
+class Cat extends Animal{
+ int lives;
+ Cat(String name, int age,int lives) {
+ super(name, age);
+ this.lives = lives;
+ }
+ @Override
+ public String makeSound(){
+ return "The Cat Meows";
+ }
+}
public class InheritanceChallenge {
public static void main(String[] args) {
+ Animal cat = new Cat("Cat",2,5);
+ Animal dog = new Dog("Scooby",3,"labora");
+ Animal lion = new Animal("lion",3);
+ Animal[] animals = {cat,dog,lion};
+ for (Animal animal: animals){
+ System.out.println(animal.name + " " + animal.age + " " + animal.makeSound());
+ }
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/InstanceOf.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/InstanceOf.java
index fe0349f..fe999c1 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/InstanceOf.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/InstanceOf.java
@@ -12,6 +12,19 @@ public static void main(String[] args) {
};
// Challenge: Use instanceof to determine the type of each object in the array
-
+ for (Object o : objects){
+ if(o instanceof Integer){
+ System.out.println(o + " is an Integer");
+ }
+ else if(o instanceof String){
+ System.out.println(o + " is an String");
+ }
+ else if(o instanceof Boolean){
+ System.out.println(o + " is an Boolean");
+ }
+ else if(o instanceof Double){
+ System.out.println(o + " is an Double");
+ }
+ }
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/JavaVariables.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/JavaVariables.java
index 2e84ae0..abd1a76 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/JavaVariables.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/JavaVariables.java
@@ -5,28 +5,47 @@ public class JavaVariables {
public static void main(String[] args) {
// Step 1: Declare and initialize variables of different data types
// int variable to store an integer value
-
+ int i =23;
// long variable to store a long value
-
+ long l = 234567L;
// float variable to store a floating-point value
-
+ float f = 3.4444f;
// double variable to store a double value
-
+ double d = 3.44444;
// char variable to store a single character
-
+ char c = 'A';
// boolean variable to store a boolean value
-
+ boolean b = true;
// String variable to store a string of characters
-
+ String s = "str";
// Step 2: Print the values of the variables to the console
-
+ System.out.println(i);
+ System.out.println(l);
+ System.out.println(f);
+ System.out.println(d);
+ System.out.println(c);
+ System.out.println(b);
+ System.out.println(s);
// Step 3: Modify the values of the variables and print the updated values
-
+ i =10;
+ l = 233L;
+ f =2.23f;
+ d =222222.22;
+ c ='B';
+ b = false;
+ s = "str1";
+ System.out.println(i);
+ System.out.println(l);
+ System.out.println(f);
+ System.out.println(d);
+ System.out.println(c);
+ System.out.println(b);
+ System.out.println(s);
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/Operators.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/Operators.java
index f35cf5f..eb7532c 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/Operators.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/Operators.java
@@ -6,31 +6,36 @@
public class Operators {
public static void main(String[] args) {
// Step 1: Declare variables
- ArrayList
+ int a = 30;
+ int b = 20;
// Step 2: Perform arithmetic operations
-
+ int sum = a+b;
+ int sub = a-b;
+
// Step 3: Print the results of the arithmetic operations
-
+ System.out.println("sub = " + sub);
// Step 4: Perform increment and decrement operations
-
+ a++;
+ b--;
// Step 5: Print the results of the increment and decrement operations
-
+ System.out.println("a = " + a);
+ System.out.println("b = " + b);
// Step 6: Perform comparison operations
-
+ boolean comp = a==b;
// Step 7: Print the results of the comparison operations
-
+ System.out.println("comp = " + comp);
// Step 8: Perform logical operations
-
+ boolean l = a!=b && b==b ? true : false;
// Step 9: Print the results of the logical operations
-
+ System.out.println("l = " + l);
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/PrimitiveAndWrapperClasses.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/PrimitiveAndWrapperClasses.java
index 07155d1..e1e534f 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/PrimitiveAndWrapperClasses.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/PrimitiveAndWrapperClasses.java
@@ -3,14 +3,14 @@
public class PrimitiveAndWrapperClasses {
public static void main(String[] args) {
// Step 1: Declare primitive variables
-
+ int i =10;
// Step 2: Convert primitive variables to wrapper objects
-
+ Integer iWrapper = i;
// Step 3: Print the values of the wrapper objects
-
+ System.out.println("iWrapper = " + iWrapper);
// Step 4: Convert wrapper objects back to primitive variables
-
+ i = iWrapper;
// Step 5: Print the values of the primitive variables
-
+ System.out.println("i = " + i);
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ReadWrite.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ReadWrite.java
new file mode 100644
index 0000000..3be0426
--- /dev/null
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/ReadWrite.java
@@ -0,0 +1,67 @@
+package io.javabrains.javabasics;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Scanner;
+
+public class ReadWrite {
+ public static void main(String[] args) throws IOException {
+ Scanner scanner = new Scanner(System.in);
+ System.out.println("Enter name");
+ String name = scanner.nextLine();
+ System.out.println("Enter Destination");
+ String dest = scanner.nextLine();
+ System.out.println(name + " travelling towards " + dest);
+
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
+ System.out.println("Enter place of brith");
+ String from = bufferedReader.readLine();
+ System.out.println(from);
+
+ scanner.close();
+ bufferedReader.close();
+
+ }
+}
+
+
+
+//Writing Output:
+//You can write output to the standard output stream (usually the console) using the System.out.println() method.
+//Example:
+//java
+//Copy code
+//public class Main {
+// public static void main(String[] args) {
+// System.out.println("Hello, world!");
+// }
+//}
+//Reading/Writing Files:
+//import java.io.BufferedReader;
+//import java.io.FileReader;
+//import java.io.IOException;
+//
+//public class Main {
+// public static void main(String[] args) throws IOException {
+// BufferedReader reader = new BufferedReader(new FileReader("input.txt"));
+// String line;
+// while ((line = reader.readLine()) != null) {
+// System.out.println(line);
+// }
+// reader.close();
+// }
+//}
+//
+//import java.io.BufferedWriter;
+//import java.io.FileWriter;
+//import java.io.IOException;
+//
+//public class Main {
+// public static void main(String[] args) throws IOException {
+// BufferedWriter writer = new BufferedWriter(new FileWriter("output.txt"));
+// writer.write("Hello, world!");
+// writer.newLine();
+// writer.close();
+// }
+//}
\ No newline at end of file
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/StaticChallenge.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/StaticChallenge.java
index a6c781c..93e6172 100644
--- a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/StaticChallenge.java
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics/StaticChallenge.java
@@ -10,9 +10,39 @@
5. In this main method, create several `Rectangle` objects, calculate and print their area and perimeter, and finally print the number of rectangles created without keeping count in this class.
*/
+class Rectangle{
+ int width;
+ int height;
+ static int noOfRectangles=0;
+
+ Rectangle(int width,int height){
+ this.width=width;
+ this.height=height;
+ noOfRectangles++;
+ }
+ public int getArea(){
+ return this.width*this.height;
+ }
+ public int getPerimeter(){
+ return 2*(this.width+this.height);
+ }
+ static int getNoOfRectangles(){
+ return noOfRectangles;
+ }
+}
public class StaticChallenge {
public static void main(String[] args) {
+ Rectangle rect1 = new Rectangle(10,20);
+ Rectangle rect2 = new Rectangle(30,20);
+
+ System.out.println("rect1.getArea() = " + rect1.getArea());
+ System.out.println("rect1.getPerimeter() = " + rect1.getPerimeter());
+
+ System.out.println("rect2.getArea() = " + rect2.getArea());
+ System.out.println("rect2.getPerimeter() = " + rect2.getPerimeter());
+
+ System.out.println(Rectangle.getNoOfRectangles());
}
}
diff --git a/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics1/C.java b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics1/C.java
new file mode 100644
index 0000000..46bdf0c
--- /dev/null
+++ b/session-03-java-basics/java-basics-exercises/src/main/java/io/javabrains/javabasics1/C.java
@@ -0,0 +1,17 @@
+package io.javabrains.javabasics1;
+
+import io.javabrains.javabasics.A;
+
+class C {
+ public void accessVars(){
+ A a = new A();
+// System.out.println("a.privateVar = " + a.privateVar); // can't perform this since it is private var
+// System.out.println("a.var = " + a.var); // can access in different package;
+// System.out.println("a.protectedVar = " + a.protectedVar); // can't access in different package
+ System.out.println("a.publicVar = " + a.publicVar);
+ }
+ public static void main(String[] args) {
+ C b = new C();
+ b.accessVars();
+ }
+}
\ No newline at end of file
diff --git a/session-04-java-collections/java-collections-exercises/.idea/misc.xml b/session-04-java-collections/java-collections-exercises/.idea/misc.xml
index 06e8b35..bffff61 100644
--- a/session-04-java-collections/java-collections-exercises/.idea/misc.xml
+++ b/session-04-java-collections/java-collections-exercises/.idea/misc.xml
@@ -7,6 +7,7 @@
+
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/AppointmentScheduler.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/AppointmentScheduler.java
index 512a11b..3bc010b 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/AppointmentScheduler.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/AppointmentScheduler.java
@@ -2,29 +2,46 @@
import java.time.LocalDateTime;
import java.util.NavigableSet;
+import java.util.SortedSet;
+import java.util.TreeSet;
// Implement the AppointmentScheduler using a NavigableSet internally
public class AppointmentScheduler {
+ private NavigableSet scheduler ;
+ public AppointmentScheduler() {
+ this.scheduler = new TreeSet<>();
+ }
+
public void addAppointment(LocalDateTime datetime) {
- throw new RuntimeException("Not implemented");
+ this.scheduler.add(datetime);
}
public LocalDateTime getNextAvailableSlot(LocalDateTime datetime) {
- throw new RuntimeException("Not implemented");
+ return this.scheduler.higher(datetime);
}
public LocalDateTime removeFirstAppointment() {
- throw new RuntimeException("Not implemented");
+ if (scheduler.isEmpty()) {
+ return null;
+ }
+ LocalDateTime time = this.scheduler.first();
+ this.scheduler.remove(this.scheduler.first());
+ return time;
}
public LocalDateTime removeLastAppointment() {
- throw new RuntimeException("Not implemented");
+ if (scheduler.isEmpty()) {
+ return null;
+ }
+ LocalDateTime time = this.scheduler.last();
+ this.scheduler.remove(this.scheduler.last());
+ return time;
}
public NavigableSet getAppointmentsAfter(LocalDateTime datetime) {
- throw new RuntimeException("Not implemented");
+ return this.scheduler.tailSet(datetime,false);
}
public static void main(String[] args) {
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/BankQueueExercise.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/BankQueueExercise.java
index aa17e8f..0734c12 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/BankQueueExercise.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/BankQueueExercise.java
@@ -3,31 +3,48 @@
// Implement the BankQueue class and methods. Look at the main method
// for clues on what the methods need to do
+import java.util.LinkedList;
+import java.util.Queue;
+
class BankQueue {
+ Queue queue = new LinkedList<>();
public void addCustomer(String customerName) {
- throw new RuntimeException("Not implemented");
+ queue.offer(customerName);
}
//
public String removeNextCustomer() {
- throw new RuntimeException("Not implemented");
+ return this.queue.poll();
}
public int getNumCustomers() {
- throw new RuntimeException("Not implemented");
+ return this.queue.size();
}
public String peekNextCustomer() {
- throw new RuntimeException("Not implemented");
+ return this.queue.peek();
}
public String peekLastCustomer() {
- throw new RuntimeException("Not implemented");
+ if(this.queue.isEmpty()){
+ return null;
+ }
+ String lastCustomer = "";
+ for (String customer : this.queue){
+ lastCustomer = customer;
+ }
+ return lastCustomer;
}
public void displayCustomers() {
- throw new RuntimeException("Not implemented");
+ if(this.queue.isEmpty()){
+ System.out.println("Empty Queue");
+ }
+
+ for (String customer : this.queue){
+ System.out.println("customer = " + customer);
+ }
}
}
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/EqualsAndHashCode.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/EqualsAndHashCode.java
index 0d665b8..95e3475 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/EqualsAndHashCode.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/EqualsAndHashCode.java
@@ -1,14 +1,138 @@
package io.javabrains.javacollections;
+import java.util.*;
+
/*
Generate a Person class with the member variables firstName, lastName, age, lastModifiedDate.
Generate equals and hashcode methods using member variables firstName, lastName, age
Compare two instances of Person that have the same data
*/
+class Person implements Comparable{
+
+ private String firstname;
+ private String lastname;
+ private int age;
+ private Date LastModifiedDate;
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public Date getLastModifiedDate() {
+ return LastModifiedDate;
+ }
+
+ public void setLastModifiedDate(Date lastModifiedDate) {
+ LastModifiedDate = lastModifiedDate;
+ }
+
+ Person(String firstname, String lastname, int age){
+ this.firstname = firstname;
+ this.lastname = lastname;
+ this.age = age;
+ this.LastModifiedDate = new Date();
+ }
+ @Override
+ public boolean equals(Object obj){
+ if(this == obj){
+ return true;
+ }
+ if(obj == null || this.getClass() != obj.getClass()){
+ return false;
+ }
+ Person person = (Person) obj;
+ return age == person.age && Objects.equals(firstname,person.firstname) && Objects.equals(lastname,person.lastname);
+ }
+ @Override
+ public int hashCode(){
+ return Objects.hash(firstname,lastname,age);
+ }
+
+ @Override
+ public int compareTo(Person obj){
+ return Integer.compare(this.age,obj.age);
+ }
+}
+
+class PersonComparator implements Comparator {
+ @Override
+ public int compare(Person p1 , Person p2){
+ return p1.getFirstname().compareTo(p2.getFirstname());
+ }
+}
+
+class PersonComparator1 implements Comparator {
+ @Override
+ public int compare(Person p1 , Person p2){
+ return Integer.compare(p1.getAge(), p2.getAge());
+ }
+}
public class EqualsAndHashCode {
public static void main(String[] args) {
+ Person p1 = new Person("Rob","Johnson",35);
+ Person p2 = new Person("Rob","Johnson",35);
+ Person p3 = new Person("Jon","Willam",33);
+ Person p4 = new Person("Jon","Willam",38);
+
+ System.out.println(p1.equals(p2));
+ System.out.println(p2.equals(p1));
+ System.out.println(p2.equals(p3));
+
+ System.out.println("=========================");
+ System.out.println(p1.hashCode()==p2.hashCode());
+ System.out.println(p3.hashCode()==p2.hashCode());
+
+ System.out.println("=========================");
+ System.out.println(p1.compareTo(p2));
+ System.out.println(p1.compareTo(p3));
+ System.out.println(p1.compareTo(p4));
+
+ System.out.println("=========================");
+ List people = new ArrayList();
+ people.add(p1);
+ people.add(p2);
+ people.add(p3);
+ people.add(p4);
+
+ System.out.println("=========================");
+
+ for (Person p : people){
+ System.out.println(p.getFirstname()+ " " +p.getAge());
+ }
+
+ System.out.println("=========================");
+
+ PersonComparator nameComparator = new PersonComparator();
+ PersonComparator1 ageComparator = new PersonComparator1();
+
+// Collections.sort(people,nameComparator);
+ Collections.sort(people,ageComparator);
+
+ for (Person p : people){
+ System.out.println(p.getFirstname()+ " " +p.getAge());
+ }
+// System.out.println(people);
}
}
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/IteratorExercise.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/IteratorExercise.java
index 03fb9c7..99dd2e6 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/IteratorExercise.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/IteratorExercise.java
@@ -1,14 +1,47 @@
package io.javabrains.javacollections;
-import java.util.ArrayList;
-import java.util.Collection;
+import java.util.*;
/*
Write code that calls the getFruits method and then iterates over the collection, printing each element to console
*/
public class IteratorExercise {
+ public static void main(String[] args){
+ FruitSupplier fruitSupplier = new FruitSupplier();
+ Collection fruits = fruitSupplier.getFruits();
+ Iterator iterator = fruits.iterator();
+ while (iterator.hasNext()){
+ String fruit = iterator.next();
+ System.out.println("fruit = " + fruit);
+ }
+ //enhanced way of doing above iteration
+ for (String fruit : fruits){
+ System.out.println("fruit = " + fruit);
+ }
+
+ ArrayList fruits1 = fruitSupplier.getFruits1();
+ ListIterator listIterator = fruits1.listIterator();
+
+ System.out.println("=====================");
+ while (listIterator.hasNext()){
+ System.out.println(listIterator.nextIndex());
+ System.out.println(listIterator.next());
+
+ }
+
+ while (listIterator.hasPrevious()){
+ System.out.println(listIterator.previousIndex());
+ System.out.println(listIterator.previous());
+ }
+ System.out.println("=====================");
+
+ System.out.println(fruits1.equals(fruits));
+ fruits1.subList(1,3).clear();
+ System.out.println(fruits1.equals(fruits));
+ System.out.println("fruits1 = " + fruits1);
+ }
}
@@ -22,4 +55,12 @@ public Collection getFruits() {
return list;
}
+ public ArrayList getFruits1() {
+ ArrayList list = new ArrayList<>();
+ list.add("apple");
+ list.add("banana");
+ list.add("cherry");
+ return list;
+ }
+
}
\ No newline at end of file
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListExercise.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListExercise.java
index 029f5d3..b591d26 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListExercise.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListExercise.java
@@ -5,10 +5,20 @@
Then write code to find the sum of all integers
*/
+import java.util.ArrayList;
+import java.util.List;
+
public class ListExercise {
public static void main(String[] args) {
+ List numbers = new ArrayList<>(List.of(1, 2));
+ numbers.add(23);
+ Integer sum =0;
+ for (Integer num :numbers){
+ sum+=num;
+ }
+ System.out.println("sum = " + sum);
}
}
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListHomework1.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListHomework1.java
index 70eaa44..7782be8 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListHomework1.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListHomework1.java
@@ -14,6 +14,64 @@
The program should continue to display the menu and allow the user to perform operations until they choose to quit.
*/
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
public class ListHomework1 {
+ public static void main (String[] args) throws IOException {
+ List list = new ArrayList(List.of(23,45,4));
+
+ BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
+ System.out.println("Choose one option\n1. Add an element to the list\n2. Remove an element from the list" +
+ "\n3. Find the minimum element in the list\n4. Find the maximum element in the list5. Print the contents of the list" +
+ "\n5. Print the contents of the list\n6. Quit the program");
+
+ int selectionOption = Integer.parseInt(bufferedReader.readLine());
+
+ while (selectionOption!=6){
+ switch (selectionOption){
+ case 1 : {
+ System.out.println("Enter Element to be added");
+ Integer element = Integer.parseInt(bufferedReader.readLine());
+ list.add(element);
+ break;
+ }
+ case 2 : {
+ System.out.println("Choose the element to be removed from below List");
+ System.out.println(list);
+ Integer element = Integer.parseInt(bufferedReader.readLine());
+ list.remove(element);
+ break;
+ }
+ case 3 :{
+ Integer min = Collections.min(list);
+ System.out.println("min = " + min);
+ break;
+ }
+ case 4 :{
+ Integer max = Collections.max(list);
+ System.out.println("max = " + max);
+ break;
+ }
+ case 5 : {
+ System.out.println(list);
+ break;
+ }
+ default :
+ throw new IllegalStateException("Unexpected value: " + selectionOption);
+ }
+ System.out.println("Choose next operation\n1. Add an element to the list\n2. Remove an element from the list" +
+ "\n3. Find the minimum element in the list\n4. Find the maximum element in the list5. Print the contents of the list" +
+ "\n5. Print the contents of the list\n6. Quit the program");
+ selectionOption = Integer.parseInt(bufferedReader.readLine());
+ }
+
+ bufferedReader.close();
+ }
+
}
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListIteratorExercise.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListIteratorExercise.java
index 7bfbc7f..d90479e 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListIteratorExercise.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListIteratorExercise.java
@@ -5,6 +5,7 @@
*/
import java.util.ArrayList;
+import java.util.ListIterator;
public class ListIteratorExercise {
@@ -16,5 +17,14 @@ public static void main(String[] args) {
list.add("Item 4");
list.add("Item 5");
+ ListIterator listIterator = list.listIterator();
+ while (listIterator.hasNext()){
+ System.out.println("next = " + listIterator.next());
+ }
+
+ while (listIterator.hasPrevious()){
+ System.out.println("previous = " + listIterator.previous());
+ }
+
}
}
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListSwap.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListSwap.java
index def14d6..366f4ac 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListSwap.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/ListSwap.java
@@ -5,9 +5,21 @@
The method should be generic and accept any List
*/
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
public class ListSwap {
public static void main(String[] args) {
-
+ List list = new ArrayList<>(List.of(23,33,44,444));
+ System.out.println(swapList(list,1,2));
+ }
+ public static List swapList(List list, int position1 , int position2) {
+ if(position1 > list.size()-1 || position2 > list.size()-1 || position1 < 0 || position2 < 0){
+ throw new Error("position not valid");
+ }
+ Collections.swap(list, position1, position2);
+ return list;
}
}
diff --git a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/VocabularyWordManager.java b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/VocabularyWordManager.java
index 82ae1dc..3380cb7 100644
--- a/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/VocabularyWordManager.java
+++ b/session-04-java-collections/java-collections-exercises/src/main/java/io/javabrains/javacollections/VocabularyWordManager.java
@@ -3,34 +3,35 @@
import java.util.Collection;
import java.util.Set;
import java.util.SortedSet;
+import java.util.TreeSet;
// Implement the VocabularyWordManager using a SortedSet internally
public class VocabularyWordManager {
+ private SortedSet words;
public VocabularyWordManager(Collection words) {
- throw new RuntimeException("Not implemented");
+ this.words = new TreeSet<>(words);
}
public String getFirstWord() {
- throw new RuntimeException("Not implemented");
+ return this.words.first();
}
public String getLastWord() {
- throw new RuntimeException("Not implemented");
-
+ return this.words.last();
}
public SortedSet getWordsBefore(String word) {
- throw new RuntimeException("Not implemented");
+ return this.words.headSet(word);
}
public SortedSet getWordsAfter(String word) {
- throw new RuntimeException("Not implemented");
+ return this.words.tailSet(word);
}
public SortedSet getWordsBetween(String startWord, String endWord) {
- throw new RuntimeException("Not implemented");
+ return this.words.subSet(startWord,endWord);
}
public static void main(String[] args) {
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/AppointmentScheduler.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/AppointmentScheduler.class
new file mode 100644
index 0000000..34b2f97
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/AppointmentScheduler.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/BankQueue.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/BankQueue.class
new file mode 100644
index 0000000..c3212de
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/BankQueue.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/BankQueueExercise.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/BankQueueExercise.class
new file mode 100644
index 0000000..da5be9a
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/BankQueueExercise.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/EqualsAndHashCode.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/EqualsAndHashCode.class
index c3153da..fda358f 100644
Binary files a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/EqualsAndHashCode.class and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/EqualsAndHashCode.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/FruitSupplier.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/FruitSupplier.class
index 60a2526..f5588f7 100644
Binary files a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/FruitSupplier.class and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/FruitSupplier.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/IteratorExercise.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/IteratorExercise.class
index c46613d..791dafe 100644
Binary files a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/IteratorExercise.class and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/IteratorExercise.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListExercise.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListExercise.class
index fb53660..75259da 100644
Binary files a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListExercise.class and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListExercise.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListHomework1.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListHomework1.class
new file mode 100644
index 0000000..a35b663
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListHomework1.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListIteratorExercise.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListIteratorExercise.class
index c1342ec..a93af2b 100644
Binary files a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListIteratorExercise.class and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListIteratorExercise.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListSwap.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListSwap.class
new file mode 100644
index 0000000..fb64b2a
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/ListSwap.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/Person.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/Person.class
new file mode 100644
index 0000000..d950ffb
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/Person.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/PersonComparator.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/PersonComparator.class
new file mode 100644
index 0000000..63b61bd
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/PersonComparator.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/PersonComparator1.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/PersonComparator1.class
new file mode 100644
index 0000000..94013c3
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/PersonComparator1.class differ
diff --git a/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/VocabularyWordManager.class b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/VocabularyWordManager.class
new file mode 100644
index 0000000..22d1e03
Binary files /dev/null and b/session-04-java-collections/java-collections-exercises/target/classes/io/javabrains/javacollections/VocabularyWordManager.class differ