java8 / Java8InAction

MIT License
3.19k stars 2.26k forks source link

java8 have filtering method ? #28

Open coderpwh1024 opened 5 years ago

coderpwh1024 commented 5 years ago

int your chap6 Group.java hava a bug , filtering method not in java8 sdk .

0003

sankalpbhatia commented 5 years ago

Looks like they added these codes for the 2nd edition. link You can try return menu.stream().filter(dish -> dish.getCalories() > 500).collect(groupingBy(Dish::getType)); which will run fine with a java 8 compiler giving the same result. But my $0.02 would be to use the latest jdk if possible.

vbhosle commented 5 years ago

switch to previous commit to get first edition code.

git reset --hard ae8122f433f90a8bfed7244cdf6f99271f1d1125

keepangry commented 4 years ago

switch to previous commit to get first edition code.

git reset --hard ae8122f433f90a8bfed7244cdf6f99271f1d1125

thanks

KitGavinx commented 4 years ago

int your chap6 Group.java hava a bug , flatMapping method also not in java8 sdk

deviltt commented 3 years ago

int your chap6 Group.java hava a bug , flatMapping method also not in java8 sdk

Have you solved this problem??