Posts

Showing posts from 2019

Java 8 Questions.

what is functional interface. Ans :- An interface defined with only on abstract method. That interface can have multiple default and static methods. Supplier, consumer and predicate are the functional interface provided by 8. Supplier FI can used as factory pattern to create object using get method of that interface. i.e. import jdk.nashorn.internal.objects.annotations.Setter; import java.util.UUID; @Setter public class Car { UUID id; String name; } public class MarutiCar extends car { } import jdk.nashorn.internal.objects.annotations.Setter; import java.util.UUID; import java.util.function.Supplier; public class CarSupplier { private static <T extends Car> T getCar( final Supplier<T> supplier, final String name) { T car = supplier.get(); car.setId(UUID.randomUUID()); car.setName(name); return car; } public static void main(String args[]) { MarutiCarr car = getCar(MarutiCar:: new , "Maruti C

Angular 6

Angular 6 Create new application. command -> ng new app_name what is data binding? >> assigning values to variables. types if binding one way > ts file to html file two way >html file to ts file vise vars Questions 1. Can we load multiple components from bootstrap? Ans. Yes you can load multiple components under bootstraps. example header, body and footer. where header is one components, body is second and footer is third. commands to create multiple components out side of root components. > ng generate component component_name app.modules.ts file need to update bootstraps. 2.  Type script - unlike js is has its different kind of type. its define variable into type. like function typeScript(x : number, y: number) {              return x+y+1.0; } console.log(typeScript(2,3)); Create new Angular Application. >> ng new PROJECT_NAME i.e ng new amar-uttam-hai

Interview Questions on Microservices

Image
Explain  Microservices architecture? Ans:-   Microservices architecture is development style which build an application as c ollection of small autonomous services for business domain.