Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip: Understanding Lambda Expresssions with a Simple Method Call

Lambda expressions have simplified the way we write code. Learn how to use a method from an interface.




Application Security Testing: An Integral Part of DevOps

Lambda expressions have simplified the way we write code. For example, let's see how to use a method from an interface.

This works with Java 1.8 only. Expected output: Welcome to Lambda expressions

public class LambdaDemo
   public static void main(String args[])
      LambdaDemo lambdaDemo = new LambdaDemo();
      //Using the interface to print 
      WelcomeMessage welcomeMessage = welcomeString -
      System.out.println("Welcome " + welcomeString);
      welcomeMessage.printMessage("to Lambda expressions");
   //Interface definition
   interface WelcomeMessage {
      void printMessage(String welcomeString);


Visit the DevX Tip Bank


Sridhar M S. is a Java developer from Bangalore, India. He holds a master's degree in Computer Science.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date