I am to have such a scenario
A class aa with ID, NAME
Class bb there is such a line
List
Aaa=new ArrayList<> (a);
for(int i=0; i<10; I++) {
===================
Aa temp=new (aa);
Temp. Id=I;
Temp. Name=I + "a1";
Aaa. Add (aa);
So I feel code is too wordy,
=====================
If direct use: aaa. Add (new aa () {... This how to the ID, NAME assignment})
Inside the {} to how to write,
}
I want to use now CodePudding user response:
Aa class to write a constructor bai refs CodePudding user response:
The