以下哪些体现了多态?
A. 内部类
B. 匿名类
C. 方法过载
D. 方法重载
以下哪些代码可编译通过且可以打印输出Equal?
A. class Check{public static void main(String args[]){int x=100;float y=100.0F;if(x==y){System.out.println(“Equal”);}}
B. class Check{public static void main(String args[]){int x=100;Integer y=new Integer(100);if(x==y){System.out.println(“Equal”);}}
C. class Check{public static void main(String args[]){Integer x=new Integer(100);Integer y=new Integer(100);if(x==y){ System.out.println(“Epual”); }}}
D. class Check{public static void main(String args[]){String x=new String(“100”);String y=new String(“100”);if(x=y){ System.out.println(“Equal”);}}}
E. class Check{public static viod main(String atgs[]){String x=new String(“100”);String y=new String(“100”);if(x==y) System.out.println(“Equal”);}}}
给出以下代码,请问以下哪些描述的正确的?public class A{AO{ }}
A. 类A可以被其他包中的类访问。
B. 类A不可以被其他包中的类访问。
C. 类A不可以被其他包中的类继承。
D. 类A可以被其他包中的类访问和继承。
E. 代码编译错误,因为公共类的构造器也必须是公共的。
给出以下代码,请问哪些是有关该方法声明的正确描述?void myMethod(String s){}
A. myMethod()方法是一个静态方法。
B. myMethod()方法没有返回值。
C. myMethod()方法是一个抽象方法。
D. myMethod()方法不能被所在的包之外的类访问。