皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
通过键盘录入数据为学生对象赋值。 将学生对象添加到集合中,并遍历集合。 import java.util.ArrayList; import java.util.Scanner; public class ArrayListTest { public static void main(String[] args ) { // 创建集合对象 ArrayList list = new ___________ ; // 调用方法,往集合中添加学生对象 addStudent ( list ); addStudent ( list ); addStudent ( list ); // 遍历集合 for ( int i = 0; i < list.size() ; i ++) { Student s = ___________ ; System. out .println( s .getName() + " : " + s .getAge()); } } public static void addStudent( ___________ list ) { // 键盘录入学生对象所需要的数据 Scanner sc = new Scanner(System. in ); System. out .println( " 请输入学生姓名 :" ); String name = sc .nextLine(); System. out .println( " 请输入学生年龄 :" ); int age = sc .nextInt(); // 创建学生对象,并设置成员变量的值。 Student s = new ___________ ; s .setName( name ); s .setAge( age ); // 往集合中添加学生对象 ___________ ; } }
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【判断题】联合操作分析的基本原则是人和机器的动作分阶段进行为最佳。
A.
正确
B.
错误
【单选题】下列各项中,不属于短期薪酬的是( )。
A.
职工福利费
B.
短期带薪缺勤
C.
辞退福利
D.
医疗保险费
【多选题】按照载体的不同,开幕词分为() 。
A.
口头致辞
B.
侧重性开幕词
C.
书面致辞
D.
一般性开幕词
【单选题】波兰人无论在正式或非正式的宴请中()。
A.
不主动敬酒
B.
都经常敬酒
C.
不主张喝酒
D.
都必须喝酒
【单选题】下列各项中,不属于职工薪酬的是()。
A.
辞退福利
B.
设定提存计划
C.
职工差旅费
D.
短期利润分享计划
【多选题】属于非导引型传输媒体的是
A.
光纤
B.
短波
C.
微波
D.
卫星通信
【单选题】The youth continued to gawk at that pretty girl and did not answer.
A.
stare stupidly
B.
stare intently
C.
grin innocently
D.
smile broadly
【单选题】Strange how the habits of his youth clung to him still! (Para. 1)
A.
It was strange that he still wanted to keep the habits of his early days.
B.
It was strange how up to that moment he had continued doing things the way he had always done them from boyhood.
C.
The habits of his early days are so strange that he still wanted to keep them.
【简答题】如果m和n是互质数,那么它们的最大公因数是( ),最小公倍数是( )
【单选题】属于非导引型传输媒体的是
A.
同轴电缆
B.
光纤
C.
双绞线
D.
自由控件
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题