格林模拟试题三(下)(5)
question 45)
what will happen when you attempt to compile and run the following code?
public class sandys{private int court;public static void main(string argv){ sandys s = new sandys(99); system.out.println(s.court); }sandys(int ballcount){ court=ballcount; }}
2) compile time error, s is not initialized when the system.out method is called
4) compilation and run with an output of 99
question 46)
which of the following statements are true?
1) a method cannot be overloaded to be less public in a child class
3) to be overridden a method must have the same name, parameter and return types
question 47)
what will happen when you attempt to compile and run the following code?
class base{base(){ system.out.println("base"); }}public class checket extends base{public static void main(string argv){ checket c = new checket(); super(); }checket(){ system.out.println("checket"); } }1) compile time error
3) base followed by checket
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>