Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

I need a little help with Java

 
Greenhorn
Posts: 2
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can you rewrite this code without lambda expression. Thanks for your help in advance  
 
Sheriff
Posts: 16039
266
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Yes, somebody probably can rewrite that code without using a lambda expression. But just so you know, we do have a strict policy on this site that you should DoYourOwnHomework (←click that, it's a link). Any solutions offered to you here that are in violation of that policy will be deleted.

What have you tried?
 
Rose Tyler
Greenhorn
Posts: 2
Python C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:Welcome to the Ranch!

Yes, somebody probably can rewrite that code without using a lambda expression. But just so you know, we do have a strict policy on this site that you should DoYourOwnHomework (←click that, it's a link). Any solutions offered to you here that are in violation of that policy will be deleted.

What have you tried?



Oh I see, sorry. I've tried this but still got an error. I am kinda beginner and I couldn't find my mistake.

 
Junilu Lacar
Sheriff
Posts: 16039
266
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"but I still got an error" is not very useful. Please TellTheDetails (←click that link)

Looking at your code, line 9 will not compile. What are you trying to do there?
 
Marshal
Posts: 71682
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Junilu Lacar wrote:. . . line 9 will not compile. . . .

. . . but the original version of line 9 looked all right.
Please avoid empty catches. Maybe when you are very experienced, you will know that exception won't actually be thrown, but if you still posting on “Beginning”, always write something in the catch.

And again, welcome to the Ranch
 
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic