Posts

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.

Web Services

Web Services :- that is client server application which communicate over www using http/s. Type of web services :- soap and rest. soap works over xml media type and rest over different media types like jason, text ext.soap stands for simple object access protocol where as rest stand for representational state transfer. WSDL: It is a web service description language, which contains the machine readable operation details of soap web service. It is used to describe formal contract details such as messages, operations, binding and web service locations. JAX-WS : used to create soap web services.  JAX-RS : used to create rest full web services. REST Full web services :- it provides stateless web services. it does not require xml message or wsdl service. is is based on below principles #1  resources identification through url : resources are identified by uri using annotations i.e @PathParmas, @QueryParms #2 uniform interfaces: resources are manipulated using defined operations i.

Custom DataType in Oracle Database.

Oracle provides the predefined types which developer can use in the PL/SQL. Those types are like NUMBER, ARRAYOFNUMBERS, VARCHAR2 and many more.  Developer who consumes PL/SQL from JAVA can easily use those types in case of normal scenario. But consider a scenario where, developer want to send collections to PL/SQL, then how that would be possible. So, oracle have provided an option to create own custom types as per requirement and use that types in PL/SQL. That custom type support essay access to data types from JAVA and speed up execution and developer can achieve performance too. Syntax of creation of custom type:- #1 TABLEOF3STRINGS:- create or replace TYPE "TRIPLETOFSTRINGS" as object (field1 varchar2(20), field2 varchar2(20), field3 varchar2(20)); create or replace TYPE "TABLEOF3STRINGS" as table of TripletOfStrings; #2 Structure with number field:- create or replace TYPE "LINEITEM" as object ( item_name varchar2(30), quanti

Improve performance of stored procedure

PL/SQL performance PL/SQL it self is used to improve the performance. In application, most of logic implemented in java having communication with database to perform database operations. Database operation from java code for more number of iteration is not a good practice. It is always advisable, if the database call are performed under large number of iteration then move that logic into PL/SQL and perform those logic there. Significant performance can be achieved by doing this. While doing code transforming from java code into PL/SQL, developer may face number of difficulties. Difficulty: Q. How to pass array of two , array of three from java to PL/SQL? Ans:- Oracle supports custom data types, where developer can create custom data type. The custom data type in the form of array of two ( i.e. pair of two strings / number ) , array of three ( triplate of  string / number ). Once those custom data type are defined in the oracle database then developer needs to form collection mat

No expectation,No Disappointment.

Expectation!Expectation!Expectation!Expectation! Every  body carries expectation in life at every stage. An individual being an child have expectation from parent, being friend have expectation best friend.Every body have expectations. What happens if the expectation are not met or not completed? lets take an example of individual being an child having expectation from parent. A child, till get matured would have expectation which are like :- #1 Parent should give a time to child. Now a days both parent works to have good life style and most important to close the home loan. Once the parent at work, child mostly kept a day care. A recent incidence, would like to share, where a child visited a family at downstairs where a kid was playing with grandmother. seeing that, child spoke to with grandmother and asked, you look after a kid daily? her mother wont kept her at Day Care. Daily my mother kept me at Day Care. I do not like that, my parent do not gives a time to me. I will als