Home > Back-end >  Bosses how to change the for loop this code to lambda expressions
Bosses how to change the for loop this code to lambda expressions

Time:04-15

String name="";
For (SysOffice SysOffice: sysUser getSysOffice ()) {
String getname.=sysOffice getname ();
Name=name + getname.
}

CodePudding user response:

String name="";
SysUser. GetSysOffice (). The foreach (e - & gt; Name=name + um participant etName ());

CodePudding user response:

String name=sysUser. GetSysOffice (). The stream (). The map (SysOffice: : getName). Collect (Collectors. Joining ());

CodePudding user response:

 
String name="";
SysUser. GetSysOffice (). The foreach (e - & gt; Name=name + sysOffice: : getName ());

CodePudding user response:

The positive solution on the second floor, lambda expressions variable is equal to be the final modification of internal use not joining together
  • Related