Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
2 views2 pages

Capgemini Coding2

Capgemini

Uploaded by

thediaryofnature
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Capgemini Coding2

Capgemini

Uploaded by

thediaryofnature
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//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;
}
}

You might also like