diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6a3417b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/out/
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/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..188022c
--- /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..ea08649
--- /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/CalculatorImpl.java b/CalculatorImpl.java
deleted file mode 100644
index 74ee688..0000000
--- a/CalculatorImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.javatechie.lambda.demo;
-
-interface Calculator {
-
- // void switchOn();
-
- /* void sum(int input); */
-
- int substract(int i1, int i2);
-}
-
-public class CalculatorImpl {
-
- public static void main(String[] args) {
-
- /*
- * Calculator calculator = () -> System.out.println("Switch On");
- *
- * calculator.switchOn();
- */
-
- /*
- * Calculator calculator = (input) -> System.out.println("Sum : " + input);
- * calculator.sum(394);
- */
-
- Calculator calculator = (i1, i2) -> {
- if (i2 < i1) {
- throw new RuntimeException("message");
- } else {
- return i2 - i1;
- }
- };
-
- System.out.println(calculator.substract(8, 20));
- }
-
- // () -> {body};
-}
diff --git a/EvenAndOddPrinter.java b/EvenAndOddPrinter.java
deleted file mode 100644
index 6f10674..0000000
--- a/EvenAndOddPrinter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.javatechie;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.function.IntPredicate;
-import java.util.stream.IntStream;
-
-public class EvenAndOddPrinter {
-
- private static Object object = new Object();
-
- private static IntPredicate evenCondition = e -> e % 2 == 0;
- private static IntPredicate oddCondition = e -> e % 2 != 0;
-
-
- public static void main(String[] args) throws InterruptedException {
- CompletableFuture.runAsync(() -> EvenAndOddPrinter.printResults(oddCondition));
- CompletableFuture.runAsync(() -> EvenAndOddPrinter.printResults(evenCondition));
- Thread.sleep(1000);
- }
-
- public static void printResults(IntPredicate condition) {
- IntStream.rangeClosed(1, 10)
- .filter(condition)
- .forEach(EvenAndOddPrinter::execute);
- }
-
-
- public static void execute(int i) {
- synchronized (object) {
- try {
- System.out.println("Thread Name " + Thread.currentThread().getName() + " : " + i);
- object.notify();
- object.wait();
- } catch (InterruptedException ex) {
- //error log
- }
- }
- }
-}
diff --git a/EvenAndOddPrinterBy2Threads.java b/EvenAndOddPrinterBy2Threads.java
deleted file mode 100644
index b7ed6bd..0000000
--- a/EvenAndOddPrinterBy2Threads.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.javatechie;
-
-public class EvenAndOddPrinterBy2Threads implements Runnable {
-
- static int count = 1;
- Object object;
-
- public EvenAndOddPrinterBy2Threads(Object object) {
- this.object = object;
- }
-
- @Override
- public void run() {
-
- while (count <= 100) {
- if (count % 2 == 0 && Thread.currentThread().getName().equals("even")) {
- synchronized (object) {
- System.out.println("Thread Name : " + Thread.currentThread().getName() + " value :" + count);
- count++;
- try {
- object.wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- }
- if (count % 2 != 0 && Thread.currentThread().getName().equals("odd")) {
- synchronized (object) {
- System.out.println("Thread Name : " + Thread.currentThread().getName() + " value :" + count);
- count++;
- object.notify();
- }
- }
-
- }
-
- }
-
- public static void main(String[] args) {
- Object lock=new Object();
- Runnable r1=new EvenAndOddPrinterBy2Threads(lock);
- Runnable r2=new EvenAndOddPrinterBy2Threads(lock);
- new Thread(r1, "even").start();
- new Thread(r2, "odd").start();
- }
-}
diff --git a/EvenAndOddPrinterByES.java b/EvenAndOddPrinterByES.java
deleted file mode 100644
index 54d351f..0000000
--- a/EvenAndOddPrinterByES.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.javatechie;
-
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.stream.IntStream;
-
-public class EvenAndOddPrinterByES {
-
- public static void main(String[] args) {
-
- ExecutorService executorService = Executors.newFixedThreadPool(2);
-
- IntStream.rangeClosed(1, 10)
- .forEach(num -> {
- CompletableFuture oddCompletableFuture = CompletableFuture.completedFuture(num)
- .thenApplyAsync(x -> {
- if (x % 2 != 0) {
- System.out.println("Thread Name " + Thread.currentThread().getName() + " : " + x);
- }
- return num;
- }, executorService);
- oddCompletableFuture.join();
-
- CompletableFuture evenCompletableFuture = CompletableFuture.completedFuture(num)
- .thenApplyAsync(x -> {
- if (x % 2 == 0) {
- System.out.println("Thread Name " + Thread.currentThread().getName() + " : " + x);
- }
- return num;
- }, executorService);
- evenCompletableFuture.join();
- });
- executorService.shutdown();
- }
-}
diff --git a/MyFunctionalInterface.java b/MyFunctionalInterface.java
deleted file mode 100644
index 65920e5..0000000
--- a/MyFunctionalInterface.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.javatechie.lambda.demo;
-
-public interface MyFunctionalInterface {
-
- void m1();
-
- default void m2() {
- System.out.println("Default method-1");
- }
-
- default void m3() {
- System.out.println("Default method-2");
- }
-
- static void m4() {
- System.out.println("static method-1");
- }
-}
diff --git a/NthHighestSalaryDemo.java b/NthHighestSalaryDemo.java
deleted file mode 100644
index 63e7c26..0000000
--- a/NthHighestSalaryDemo.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package com.javatechie;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-public class NthHighestSalaryDemo {
-
- public static void main(String[] args) {
-
- Map map1 = new HashMap<>();
- map1.put("anil", 1000);
- map1.put("bhavna", 1300);
- map1.put("micael", 1500);
- map1.put("tom", 1600);//output
- map1.put("ankit", 1200);
- map1.put("daniel", 1700);
- map1.put("james", 1400);
-
- Map.Entry results = getNthHighestSalary(4, map1);
- System.out.println(results);
-
- Map map2 = new HashMap<>();
- map2.put("anil", 1000);
- map2.put("ankit", 1200);
- map2.put("bhavna", 1200);
- map2.put("james", 1200);
- map2.put("micael", 1000);
- map2.put("tom", 1300);
- map2.put("daniel", 1300);
-
- //System.out.println(getNthHighestSalary(2, map2));
-
-
- System.out.println(getDynamicNthHighestSalary(3, map1));
-
- }
-
- public static Map.Entry getNthHighestSalary(int num, Map map) {
- return map.entrySet().stream()
- .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
- .collect(Collectors.toList())
- .get(num - 1);
- }
-
- public static Map.Entry> getDynamicNthHighestSalary(int num, Map map) {
- return map.entrySet()
- .stream()
- .collect(Collectors.groupingBy(Map.Entry::getValue,
- Collectors.mapping(Map.Entry::getKey, Collectors.toList())
- ))
- .entrySet()
- .stream()
- .sorted(Collections.reverseOrder(Map.Entry.comparingByKey()))
- .collect(Collectors.toList())
- .get(num - 1);
- }
-}
diff --git a/Optional/Customer.java b/Optional/Customer.java
deleted file mode 100644
index e38c673..0000000
--- a/Optional/Customer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.javatechie;
-
-import java.util.List;
-import java.util.Optional;
-
-public class Customer {
-
- private int id;
- private String name;
- private String email;
- private List phoneNumbers;
-
- public Customer() {
- }
-
- public Customer(int id, String name, String email, List phoneNumbers) {
- this.id = id;
- this.name = name;
- this.email = email;
- this.phoneNumbers = phoneNumbers;
- }
-
- public int getId() {
- return id;
- }
-
- public void setId(int id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Optional getEmail() {
- return Optional.ofNullable(email);
- }
-
- public void setEmail(String email) {
- this.email = email;
- }
-
- public List getPhoneNumbers() {
- return phoneNumbers;
- }
-
- public void setPhoneNumbers(List phoneNumbers) {
- this.phoneNumbers = phoneNumbers;
- }
-}
diff --git a/Optional/EkartDataBase.java b/Optional/EkartDataBase.java
deleted file mode 100644
index eb7f756..0000000
--- a/Optional/EkartDataBase.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.javatechie;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-public class EkartDataBase {
-
-
- public static List getAll() {
- return Stream.of(
- new Customer(101, "john", "john@gmail.com", Arrays.asList("397937955", "21654725")),
- new Customer(102, "smith", "smith@gmail.com", Arrays.asList("89563865", "2487238947")),
- new Customer(103, "peter", "peter@gmail.com", Arrays.asList("38946328654", "3286487236")),
- new Customer(104, "kely", "kely@gmail.com", Arrays.asList("389246829364", "948609467"))
- ).collect(Collectors.toList());
- }
-
-
-}
diff --git a/Optional/OptionalDemo.java b/Optional/OptionalDemo.java
deleted file mode 100644
index ccabd0e..0000000
--- a/Optional/OptionalDemo.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.javatechie;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
-
-public class OptionalDemo {
-
-
-
- public static Customer getCustomerByEmailId(String email) throws Exception {
- List customers = EkartDataBase.getAll();
- return customers.stream()
- .filter(customer -> customer.getEmail().equals(email))
- .findAny().orElseThrow(()->new Exception("no customer present with this email id"));
-
- }
-
- public static void main(String[] args) throws Exception {
-
- Customer customer=new Customer(101, "john", "test@gmail.com", Arrays.asList("397937955", "21654725"));
-
- //empty
- //of
- //ofNullable
-
- Optional