Thursday, 22 August 2024

lambda java

 https://www.javaprogramto.com/2019/06/java8-lambda-expressions.html

Wednesday, 21 August 2024

Interview preparation Topic

 Object class and its method.

Class and object

equal() and Hash()

String vs String()

StringBuilder vs String Buffer.

Opps Pilor

Interface

Abstraction


functional interview question 

consumer

supplyer

function

Bifunctional 

Predicate<Integer>isEven = x -> x%2==0;
Predicate<Integer>isNotNull = x->x!=null;
System.out.println(isNotNull.and(isEven).test(null));
System.out.println(isEven.test(2));
System.out.println(isEven.test(3));

Supplier<String>supplier = () -> String.valueOf(UUID.randomUUID());
System.out.println(supplier.get());

Consumer<String> toUpperCase = x->System.out.println(x.toUpperCase());
toUpperCase.accept("Hello, world!");


Function<String,Integer>function = x->x.length();
System.out.println(function.apply("test"));


BiFunction<String,String,Integer>biFunction = ( a, b) -> a.length() + b.length();
System.out.println(biFunction.apply("ravi","bhushan"));

BiConsumer<String,String>biConsumer = (a,b)-> System.out.println(a+b);
biConsumer.accept("lll","kkk");


BiSupplierWithReturn biSupplierWithReturn = (a,b)-> List.of(a,b);
System.out.println(biSupplierWithReturn.apply(1,3));


Friday, 9 August 2024

Websocket programing

 https://www.toptal.com/java/stomp-spring-boot-websocket

https://spring.io/guides/gs/messaging-stomp-websocket

Thursday, 8 August 2024