 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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
How to debug lambda expressions in Java?
The lambda expression composed of two parts, one is an argument and another one is code or expression. These two parts have separated by an arrow operator "->". We can use different IDE's like Netbeans, IntelliJ, and Eclipse to debug the lambda expressions in Java. It is always possible to create multi-line lambda expressions and use print statements to display the values of a variable. The debugger can also provide additional information about the state of a java program. It allows some variables to be modified while the debugger is executing.
Syntax
(parameters) -> expression   or (parameters) -> { statements; }  Example
import java.util.*; public class LambdaDebugTest {    public static void main(String args[]) {       List<Strng> list = Arrays.asList("jai", "adithya", "raja");       list.stream()           .map(s -> s + " - " + s.toUpperCase())  // Convert to upper case using lambda           .forEach(s -> System.out.println(s));   // To print 's' using lambda    } } Output
jai - JAI adithya - ADITHYA raja - RAJA
Advertisements
 