Java Application源程序的主类是指包含有( )方法的类。
A.main方法 B.toString方法
C.init方法 D.actionPerfromed方法
1: Person p;
2: Teacher t;
3: Student s; //p, t and s are all non-null.
4: if(t instanceof Person) { s = (Student)t; }
第4行语句的结果是( )
A. 将构造一个Student对象。 B. 表达式是合法的。
C. 表达式是错误的。 D. 编译时正确,但运行时错误。
异常是在什么时候发生的?( )
A.编写程序时 B.编译时 C.运行时 D.最终用户发出请求时
设有下面的两个类定义:
class AA {
void Show(){ System.out.println(“我喜欢Java!”); }
class BB extends AA {
void Show(){ System.out.println(“我喜欢C++!”);}
则顺序执行如下语句后输出结果为:( )
AA a = new AA(); BB b = new BB();
a.Show(); b.Show();
A.我喜欢Java! B.我喜欢C++!
我喜欢C++! 我喜欢Java!
C.我喜欢Java! D.我喜欢C++!
我喜欢Java! 我喜欢C++!