Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Thanks for providing this article. Really informative.
- Madhumita Bhattacharjee
Again, this article convince me to not use Lambda expression. 1) Shorter code (in number of lines) don’t means better code 2) Anonymous class , if you are a good Java developer, you never use them 3) For parlellism, a good usage of threads is better than this. Because here the exemple show an ideal case, each task are independant, but if you need synchronize some result in future, you have to write every things. So why not directly write with good thread management ? 4) For pass method as argument is useless, a good management interface and abstract fit. 5) Its not seems very evolutive, if you need change something (You know in real life, every code need to change), you have to change in several place. Not very connient. Conclusion : It may be use for test, but for a real code, its not a good idea. It still don’t understand why lambda exists. Is it for bad developer to be able developer worser ?
- JHElp
Nice tutorial. Just a little bug in your code for prime numbers: //Declarative approach private static boolean isPrime(int number) { return number > 1 && IntStream.range(2, **number - 1**).noneMatch( index -> number % index == 0); } I think you mean “range(2, number)” since the end is exklusive :)
- Sam
What is numberTest here ?? return numbers.stream() .filter(NumberTest::isOdd) //Predicate is functional interface and .filter(NumberTest::isGreaterThan3) // we are using lambdas to initialize it .filter(NumberTest::isLessThan11) // rather than anonymous inner classes .max(Comparator.naturalOrder()) .map(i -> i * i) .get();
- Vipul
I didnt get how you are marking interfaces as funcyional or non functional on basis of signature. Please explain.
- nimisha
I am new in Functional Interface and today i am learning from few of tutorial sites. I have a question plz provide your suggestions and guide me. Below mentioned code have an question for me. @FunctionalInterface interface Demo { Object clone(); // protected //int hashCode(); // public //boolean equals(Object c); // public //public void wait(); // final so we cannot override this one. } > Object class is parent for all java classes. > here wait() method says not overrided bcoz this one is final. So its mean Demo interface also child of Object class (in general terms). > @FunctionalInterface means interface with exact one method declaration. > Question: So, Now code is working when **Object clone();** method is not commented. So means this method is declared in interface Demo. But when we click on its implementation we move on Object class’s clone() method. When we comment clone() method and un-comment equals() method, then we get compile time error, interface is not FunctionalInterface. Why ??? and why its functional interface with clone() method. Please don’t say clone() is protected, what’s the matter if clone is protected in Object class. Please explain for me. Thanks, sawai
- sawai
Hi ALl, I have created a program taking blog example and try to find out the execution time of the method with and without Lamda operation. public class IsPrimeNumber { public static void main(String [] argd) { System.out.println(Calendar.getInstance().getTimeInMillis()); System.out.println(IsPrimeNumber.isPrimeLamda(99)); System.out.println(Calendar.getInstance().getTimeInMillis()); System.out.println(Calendar.getInstance().getTimeInMillis()); System.out.println(IsPrimeNumber.isPrime(99)); System.out.println(Calendar.getInstance().getTimeInMillis()); } private static boolean isPrime(int number) { if(number < 2) return false; for(int i=2; i 1 && IntStream.range(2, number).noneMatch( index -> number % index == 0); } } But in the result, the time taken by the standard method is less than the Lamda operation. method. In actual it increases the execution time of the program Thanks Atul Sharma
- Atul Sharma