
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Raja has Published 469 Articles

raja
3K+ Views
A functional Interface for which a lambda expression has invoked is called target type of lambda expression. It means that if a lambda expression has invoked for some "X" interface then "X" is the target type of that lambda expression. Hence, we conclude that lambda expressions can be used only in those ... Read More

raja
3K+ Views
The conditional operator is used to make conditional expressions in Java. It is also called a Ternary operator because it has three operands such as boolean condition, first expression, and second expression.We can also write a conditional expression in lambda expression in the below program.Exampleinterface Algebra { int substraction(int ... Read More

raja
847 Views
A cast expression provides a mechanism to explicitly provide a lambda expression's type if none can be conveniently inferred from context. It is also useful to resolve ambiguity when a method declaration is overloaded with unrelated functional interface types.SyntaxObject o = () -> { System.out.println("TutorialsPoint"); }; // Illegal: Object o = ... Read More

raja
12K+ Views
A return statement is not an expression in a lambda expression. We must enclose statements in braces ({}). However, we do not have to enclose a void method invocation in braces. The return type of a method in which lambda expression used in a return statement must be a functional interface.Example 1public class ... Read More

raja
2K+ Views
An array is a fixed size element of the same type. The lambda expressions can also be used to initialize arrays in Java. But generic array initializes cannot be used.Example-1interface Algebra { int operate(int a, int b); } public class LambdaWithArray1 { public static void main(String[] args) { ... Read More

raja
655 Views
In Java 8, lambda expression accepts an anonymous function as a parameter. In the case of providing an anonymous method, we can also pass references of existing methods using "::" symbol. A method reference enables us to do the same thing but with existing methods.We can also implement an action listener for ... Read More

raja
8K+ Views
Lambda expression is an anonymous method (method without a name) that has used to provide the inline implementation of a method defined by the functional interface while a method reference is similar to a lambda expression that refers a method without executing it. The arrow (->) operator can be used to connect the argument and ... Read More

raja
1K+ Views
A method reference is a new feature in Java 8, which is related to Lambda Expression. It can allow us to reference constructors or methods without executing them. The method references and lambda expressions are similar in that they both require a target type that consists of a compatible functional interface.SyntaxClass :: instanceMethodNameExampleimport java.util.*; ... Read More

raja
11K+ Views
The lambda expressions are inline code that implements a functional interface without creating an anonymous class. In Java 8, forEach statement can be used along with lambda expression that reduces the looping through a Map to a single statement and also iterates over the elements of a list. The forEach() method defined ... Read More

raja
9K+ Views
In Java 8, we have the ability to convert an object to another type using a map() method of Stream object with a lambda expression. The map() method is an intermediate operation in a stream object, so we need a terminal method to complete the stream.SyntaxStream map(Function