您现在的位置:在线题库 >> 计算机类 >> JAVA程序设计
  • ID:9110-26914Java中的构造方法的主要作用是:

  • 相关试题查看更多

  • ID:9110-1518

    x=4.7,a=7,y=2.5,算术表达式x+a%3*(int)(x+y)%2/4的值为:

    查看解析

  • ID:9110-11569

    Java Application程序的主类是指包含有( )方法的类。

    A.main方法 B.toString方法

    C.init方法 D.actionPerfromed方法

    查看解析

  • ID:9110-11027
    TeacherStudent是类Person的子类;

    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. 编译时正确,但运行时错误。

    查看解析

  • ID:9110-1137

    异常是在什么时候发生的?( )

    A.编写程序 B.编译时 C.运行时 D.最终用户发出请求时

    查看解析

  • ID:9110-11581

    设有下面的两个类定义:

    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++!

    查看解析