Posts

Showing posts with the label Java

Java 8 Function Interface

Java.Util.Function ------------------------ Java.Util.Function added in java 8. So let's have a closer look into it. To go through the documentation click the below link. https://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html The 4 important topics are , 1. Predicate 2. Consumer   3. Function 4. Supplier A youtube example for better understanding is :  https://www.youtube.com/watch?v=Tapz6_T5oHY Consumer :  --  two methods, accept(T t) and andThen() ** accept(T t) , returns void means no thing returned. It accepts only input. **andThen executes two consumers one after another. #java #java8 #java 8 #java.util.function #javaFunction #java function #java consumer #java predicate #java supplier #java lambda expression

Web Services And APIs

Image
 In progress We b ser vic es An d A P I Int egra tion B asics ------------------------------------------------------------- Webservices : Webservices are synchronous services. Because immediately we send the request, we get the response. API (Application Program Interface) In the above image, from the local system, we send a request to the API ( a program to calculate the addition) which is located in a remote server through HTTP. In return, we get the response of the added value as part of the response over HTTP.API is nothing but a program that performed the requested task by taking the request value processing them and returning the response. Requirement : I have a .java application and also an application built with .net.i wanted to connect with each other. Bu t they are two different applications built with different technologies. So to communic ate with 2 different applications built in totally different languages is difficult to interact with. we need a common set of sta...

Java Script

                                Java Script   Synchronous Java script : In this java script programs run line by line sequentially.   Let :   var a=1; var b=2; console.log(a); console.   Result: 1 2   Asynchronous : Follows the non-sequential manner of the code execution and unexpected execution time of code.   var a = 1; fetch(“/”,function({ console.log(“loaded page”) }) Console.log(“a”);   Result : 1 Loaded     Ex:2   setTimeout Function     setTimeout(function(){ concole.log(“hello world”) },1000)               Var a=1; setTimeout(function(){ console.log(“helloi world”) },1000) Console.log(“a”);   Result : 1 Hello World ...