最新回答 / 丧心病狂周大仙
public static void main(String[] args) { // TODO Auto-generated method stub TestSet st=new TestSet(); st.testAdd(); st.testForEach(); Student student=new Student("1","小明"); System.out.println("欢迎学生"+student.name+"选...
2017-04-23
最新回答 / polaris张
<...code...>public class PokerDemo { public static void main(String[] args) { // 创建一个HashMap集合 HashMap&StrInteger, String& Ha hm = new HashMap&StrInteger, String&建一个(); // 创建一个ArrayList集合 ArrayList&ew Integer&t&l array = ...
2017-04-23
最新回答 / 想要学习的小懒虫
Java语言是要面对对象的,就是要有所谓的OOP思想。基本类型,直接存数值,不能调用方法和保存在集合类ArrayList等中,也就是说不能直接面对对象;包装类是类,产生对象时用一个引用指向这个对象,可以理解为指向这个对象的地址,包装类的对象拥有方法,可以实现更多功能,如可以加以调用相应的属性值等
2017-04-23
最新回答 / Be_yond
菜鸟教程,《Java 核心技术》
最新回答 / 大的小彩笔
for(int i=0;i<3;){ System.out.println("请输入学生ID"); String id=scan.next(); Student s=students.get(id); if(s==null){ System.out.println("输入学生姓名:"); String name=scan.next(); Student stu=new Student(id,name); students.put(id, stu); Sy...
2017-04-21
最新回答 / 慕圣0830664
你在test()方法中输出的是后一个 new Student("1", "小明")中的courses容器的元素,而不是前面已经定义过了student对象中的courses。也就是说,在上面的程序中,你创建了两个Student类对象。第一个是被初始化过的,里面的courses容器存放了小明选择的课程;第二个 new Student("1", "小明"), 在new的时候调用了Student类的构造方法,只是id和name被初始化过,而courses容器中并没有添加东西。你输出的刚好是一个没有添加任务元素的c...
2017-04-21