【分录题】写出以下程序运行结果。 public class Demo8 { public static void main(String[] args) { int sum=0; while(true) { for(int i=1,j=2;i<10;i++) { if(i*j%3="=0)" continue; sum="sum+i;" } if(sum>20) break; } System.out.println(sum); } }
第1题
第2题
第3题
第4题
第5题
【分录题】(6-9)请阅读程序,写出程序运行结果。 class Phone{ private String name; private int price; public Phone(String name, int price) { this.name = name; this.price = price; } public String toString() { return ""+this.price; } } public class PhoneDemo { public static void main(String[] args) { StringBuffer sb=new StringBuffer(); Phone [] list=new Phone[3]; list[0]=new Phone("华为",3000); list[1]=new Phone("小米8",4000); list[2]=new Phone("vivo R10",2300); for(Phone p:list) sb.append(p); System.out.println(sb.toString()); } }
第6题
第7题
第8题
第9题
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!