📄 例7-7.txt
字号:
import java.util.*;
class Student
{
String name ;
int number;
float score;
Student(String name,int number,float score)
{
this.name=name;
this.number=number;
this.score=score;
}
}
public class Example
{
public static void main(String args[])
{
LinkedList<Student> mylist=new LinkedList<Student>();
Student stu_1=new Student("赵民" ,9012,80.0f),
stu_2=new Student("钱青" ,9013,90.0f),
stu_3=new Student("孙枚" ,9014,78.0f),
stu_4=new Student("周右" ,9015,55.0f);
mylist.add(stu_1);
mylist.add(stu_2);
mylist.add(stu_3);
mylist.add(stu_4);
Iterator<Student> iter=mylist.iterator();
while(iter.hasNext())
{
Student te=iter.next();
System.out.println(te.name+" "+te.number+" "+te.score);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -