APP下载
首页
>
财会金融
>
Java计算机考试题题库
搜索
Java计算机考试题题库
题目内容
(
单选题
)
4. (判断题)接口中只能定义常量和抽象方法。

答案:对

Java计算机考试题题库
31. (单选题)
为了区分重载方法中同名的不同方法,要求( )。
调用时用类名或对象名做前缀
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-dde8-c04c-ee30166b1a00.html
点击查看题目
9 Person t=new Teacher();
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-1a98-c04c-ee30166b1a01.html
点击查看题目
24. (单选题)下面对于构造方法的描述,错误的是哪项?
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-3378-c04c-ee30166b1a00.html
点击查看题目
3. (单选题)下列赋值语句会产生编译错误的是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-0880-c04c-ee30166b1a01.html
点击查看题目
4 }
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-6a28-c04c-ee30166b1a03.html
点击查看题目
20. (单选题)
请先阅读下面的代码。
int x = 1;
int y = 2;
if (x % 2 == 0) {
y++;
} else {
y--;
}
System.out.println( );
上面一段程序运行结束时,变量y的值为( )。
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b79-f8e0-c04c-ee30166b1a00.html
点击查看题目
1. (单选题)不是Java关键字的是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-0498-c04c-ee30166b1a03.html
点击查看题目
41. (单选题)
下列叙述正确的是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-ed88-c04c-ee30166b1a01.html
点击查看题目
8. (单选题)现有类A和接口B,以下选项中表示类A实现接口B的是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-2650-c04c-ee30166b1a00.html
点击查看题目
8. (单选题)有一个类A,对其构造方法的声明正确的是( )。
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-5a88-c04c-ee30166b1a01.html
点击查看题目
首页
>
财会金融
>
Java计算机考试题题库
题目内容
(
单选题
)
手机预览
Java计算机考试题题库

4. (判断题)接口中只能定义常量和抽象方法。

答案:对

分享
Java计算机考试题题库
相关题目
31. (单选题)
为了区分重载方法中同名的不同方法,要求( )。
调用时用类名或对象名做前缀

B.  参数名不同

C.  返回值类型不同

D.  采用不同的参数列表

https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-dde8-c04c-ee30166b1a00.html
点击查看答案
9 Person t=new Teacher();
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-1a98-c04c-ee30166b1a01.html
点击查看答案
24. (单选题)下面对于构造方法的描述,错误的是哪项?

A.   方法名必须和类名相同

B.   方法名的前面没有返回值类型的声明

C.   在方法中不能使用return语句返回一个值

D.   当定义了带参数的构造方法,系统默认的不带参数的构造方法依然可以调用

https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-3378-c04c-ee30166b1a00.html
点击查看答案
3. (单选题)下列赋值语句会产生编译错误的是( )。

A.   char ch=’a’;

B.   double d=2.0;

C.   int c=2;

D.   float d=2.0;

https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-0880-c04c-ee30166b1a01.html
点击查看答案
4 }

A.   import java.awt.*;

B.   package mypackage;

C.   class OtherClass{ }

D.   public class MyClass{ }

https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-6a28-c04c-ee30166b1a03.html
点击查看答案
20. (单选题)
请先阅读下面的代码。
int x = 1;
int y = 2;
if (x % 2 == 0) {
y++;
} else {
y--;
}
System.out.println( );
上面一段程序运行结束时,变量y的值为( )。

A.   1

B.   2

C.   3

D.   4

解析:null
填空题

https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b79-f8e0-c04c-ee30166b1a00.html
点击查看答案
1. (单选题)不是Java关键字的是( )。

A.   integer

B.   double

C.   float

D.   Char

https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-0498-c04c-ee30166b1a03.html
点击查看答案
41. (单选题)
下列叙述正确的是( )。

A.  成员变量的名字不可以与局部变量的名称相同

B.  方法的参数名字可以与方法中声明的局部变量名称相同

C.  成员变量没有默认值

D.  局部变量没有默认值

https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-ed88-c04c-ee30166b1a01.html
点击查看答案
8. (单选题)现有类A和接口B,以下选项中表示类A实现接口B的是( )。

A.   class A extends B

B.   class B implements A

C.   class B extends A

D.   class A implements B

https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-2650-c04c-ee30166b1a00.html
点击查看答案
8. (单选题)有一个类A,对其构造方法的声明正确的是( )。

A.   class A(int x){…}

B.   A(int x){…}

C.   A A(int x){…}

D.   int A(int x){…}

https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-5a88-c04c-ee30166b1a01.html
点击查看答案
试题通小程序
试题通app下载