已采纳回答 / 慕粉2123195469
when you type into a line of words or codes,please end with "\n";for example:System.out.println("please enter a number:");Scanner s = new Scanner(System.in); String line = s.nextLine(); because nextLine()自动读取了被next()去掉的Enter作为他的结束符
2017-07-11
已采纳回答 / 慕粉13685516540
有啊,你第一个和第三个都是多态表示的,即父类引用的是子类的实例,我就简单对上面两个做一个比较,下面同理,第一个中的list只能使用List中的方法,调用子类方法就会报错,第二个可以使用本类和自称父类中的方法
2017-07-11
已采纳回答 / qq_StarFlower_0
重写equals语句是对当前类中的方法的,而调用的equals是String类中的,不是同一个类中的,我是这么理解的。不知道有没有错。
2017-07-11
已采纳回答 / qq_力_3
因为Math.random()出来的数据是double型,需要用int进行强制转换。先用Math.random乘以10,然后用int去掉小数点后面的数据,这样得到的数据就是整型了。
2017-07-01
已采纳回答 / 慕斯4356183
判断是否有重复的数字不应该放在循环判定条件内public static void main(String[] args) { // TODO Auto-generated method stub int sum=0; int count=0; for(int a=1;a<5;a++){ for(int b=1;b<5;b++){ for(int c=1;c<5;c++){ if(a==b||a==...
2017-06-26