Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8231017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:19:55+00:00 2026-06-07T17:19:55+00:00

I hear lambdas are coming soon to a Java near you (J8). I found

  • 0

I hear lambdas are coming soon to a Java near you (J8). I found an example of what they will look like on some blog:

SoccerService soccerService = (teamA, teamB) -> {
    SoccerResult result = null;
    if (teamA == teamB) {
        result = SoccerResult.DRAW;
    }
    else if(teamA < teamB) {
        result = SoccerResult.LOST;
    }
    else {
        result = SoccerResult.WON;
    }

    return result;
};

So right off the bat:

  • Where are teamA and teamB typed? Or aren’t they (like some weird form of generics)?
  • Is a lambda a type of closure, or is it the other way around?
  • What benefits will this give me over a typical anonymous function?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:19:57+00:00Added an answer on June 7, 2026 at 5:19 pm

    The Lambda expression is just syntactic sugar to implement a target interface, this means that you will be implementing a particular method in the interface through a lambda expression. The compiler can infer the types of the parameters in the interface and that’s why you do not need to explicitly define them in the lambda expression.

    For instance:

    Comparator<String> c = (s1, s2) -> s1.compareToIgnoreCase(s2);
    

    In this expression, the lambda expression evidently implements a Comparator of strings, therefore, this implies the lambda expression is syntactic sugar for implementing compare(String, String).

    Thus, the compiler can safely assume the type of s1 and s2 is String.

    Your target interface type provides all the information the compiler needs to determine what are the actual types of the lambda parameters.

    Briant Goetz, Java Language Architect at Oracle Corportion has published a couple of articles of the work in progress in JDK 8 Lambdas. I believe the answers to your questions are there:

    • State of Lambda.
    • State of Lambda Libraries Edition.
    • Translation of Lambda Expressions
    • JVMLS 2012: Implementing Lambda Expressions in Java

    This second article explains how the lambda expressions are implemented at the bytecode level and may help you delve into the details of your second question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hear is my code. I would like to get picture with api php facebook.
I hear D is link-compatible with C. I'd like to use D to create
You hear terms like classpath, build path, etc. all the time, referencing a list
I often hear things like Can we load our employee info using LDAP? Yet,
I hear a lot about functional languages, and how they scale well because there
When I hear a list , I expect there will be more than one
I hear repeatedly that while NFS-style files systems are available on IBM mainframes, they
I would like to hear how you would solve this sort of programming task!?
I'd like to hear your suggestions on how to effectively store cookies, that are
I hear logarithms mentioned quite a lot in the programming context. They seem to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.