Home > Back-end >  Help: why the List of the get () after the assignment is similar to the C language reference?
Help: why the List of the get () after the assignment is similar to the C language reference?

Time:04-27

Package cn. Hzpost. Util.

import java.util.ArrayList;
import java.util.List;

The import cn. Hzpost. Entity. The Text;
Public class Test3 {

Public static void main (String [] args) {

List The text list=new ArrayList (a);
The Text list. Add (new Text (" 1 ", "President", "leadership"));
The Text list. Add (new Text (" 2 ", "cashier", "staff"));
System. The out. Println (the text list. Get (0));
The Text Text=the Text list. Get (0);//assignment is quoted here???????

Text. SetIdx (" 11 ");
Text. SetRole (" President ");
Text. SetMsg (" great leader ");
System. The out. Println (the text list. Get (0));

//run results:
//Text [independence idx=1, role=governor, MSG=leadership]
//Text [independence idx=11, role=big governor, MSG=great leadership]//why change?

}
}
  • Related