i need someone to assist me in writting lamda expression.
THE CODE IS ABOUT 15 LINES
use this code snipt

List<fruit> fruits = createFruitArrayList () ; 
Frit LargeApple = null;
for (Fruit fruit:fruits) {
  if (fruit.getType() == null
     largeApple = fruit;
    }
  }

}

just rewrite plz

Recommended Answers

All 4 Replies

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you.

DaniWeb Member Rules (which you agreed to when you signed up) include:
"Do provide evidence of having done some work yourself if posting questions from school or work assignments"
http://www.daniweb.com/community/rules

That won't even compile.
And no, I won't rewrite that for you. I won't use lambdas, they're ugly, hard to read, an abomination.

I like lambdas, but I have no idea what your code is supposed to do, therefore have no idea how to refactor it. Do you really intend to repeatedly overwite the new values of largeApple?

well, he's getting a ClassCastException on the first attempt ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.