Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

OCA Study Guide Chapter 4 review question 21 I do not understand it How to make it run?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
1: interface Climb {
2:    boolean isTooHigh(int height, int limit)
3: }
4:
5: public class Climber {
6:    public static void main(String [] args) {
7:     check ((h,l) -> h.append(l).isEmpty(), 5); // what should this be to make it run?
8:     }
9: private static void check(Climb climb, int height) {
10:    if(climb.isTooHigh(height, 10) System.out.println("too high");
11:    else System.out.println("ok");
12:   }
13: }

I struggle with reading these lambda expression .... can anyone point me to a tutorial that explains it differently than in the book as I do not get it.

 
Liliane Top
Greenhorn
Posts: 25
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I found a very good explanation in another thread. Can I remove this one or link it to that thread?
 
Sheriff
Posts: 28344
97
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Posting a link to that other thread would be an excellent idea, yes.
 
Liliane Top
Greenhorn
Posts: 25
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This is the link https://coderanch.com/t/668480/certification/lambda-Chapter-pg-Java-OCA#3119904
 
Liliane Top
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This is the link Other thread
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    Bookmark Topic Watch Topic
  • New Topic