• Post Reply 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Sybex CSG page 534 errata?

 
Ranch Hand
Posts: 415
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I overlooked something, I did not see this here.  

4: Duck d -> d.canQuack(); // DOES NOT COMPILE

Lines 3 and 4 require parentheses around each parameter list.



Missing for line 4 is that the body must remove the semicolon?  Optionally, add braces,{}, and the return keyword?
 
Marshal
Posts: 71047
291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure I understand the problem. Maybe there is a () for empty parameter list missing, but you are then also missing a =. The semicolon would then be after the whole λ and would therefore be correct.
 
Campbell Ritchie
Marshal
Posts: 71047
291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aaaaaaaaaaaaaaaaaaaaaaaaaaah! I have just seen that Duck is the type of the parameter. I which case the λ should readorIn which case I think you are right; you probably shouldn't have the semicolon in the first version.
 
Charles O'Leary
Ranch Hand
Posts: 415
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Campbell.
 
author & internet detective
Posts: 40283
819
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is true. We were just listing the first problem
 
I once met a man from Nantucket. He had a tiny ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic