java中面向对象题目
1、5.程序执行的结果是:()。 public class Point{ int y = 7; public void step(int y) { y += y; System.out.println(y); } public static void main(String[] args) { Point p = new Point(); p.step(10); }}此题结果为20;

3、结果为:9
4、public class Answer { public static void main(String[] args) { int score = 20; Answer ans= new Answer(); ans.add(score); System.out.println(" main: score = " + score); } void add(int score) { System.out.println(" add: score=" + score++); } }

6、.关于下列代码说法正确的是:(B)。 public class Storm { public void find() { } public String find() { return "find"; } public double find(int x) { return 2.0; } } A.无编译错误 B.代码 public String find() { 行,出现编译错误 C.代码 public double find(int x) {行,出现编译错误 D.代码 return "find";行处出现编译错误

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。