//employee class - id, name, salary, employee list
List<Employee> empList={e1,e2,e3,e4};
e1 = {1,"A",10000}
e1 = {1,"B",11000}
List<Employee> empList={e1,e2,e3,e4};
e1 = {1,"A",10000}
e1 = {1,"B",11000}
e2 = {1,"C",12000}
e4= {1,"D",12000}
SELECT *FROM Employee ORDER BY SALARY ASC;
SELECT MAX(salary) FROM Employee Where salary<( SELECT MAX(SALARY) FROM EMPLOYEE);
emplist.stream().sort(Comparator.comparingDouble(emp->emp.getsalary()));
emplist.stream().sort(Comparator.comapringDouble(emp->emp.getSalary()).reversed());
@FunctionalInterface
interface SayHello{
void printMessage();
}
public class Main{
public static void main(String[] args){
SayHello s1 = ()->System.out.println("Hello Durga");
s1.printMessage();
}
}
public class Singlton{
private static Singlton obj ;
private Singlton(){
}
public static Singlton getObj(){
if(obj==null){
synchronized(Singlton.class){
if(obj==null){
obj = = new Singlton();
}
}
return obj;
}
@RestController
public class MyController{
@GetMapping("/hello/{name}")
public String sayHello(@PathVariable String name){
return "Hi" +name;
}
}