11. (单选题)
下列语句序列执行后,b的值是( )。
int b=9,a=6;
while(--a!=3) b=b+2;
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-1820-c04c-ee30166b1a00.html
点击查看答案
51. (填空题)Java中专门用于将日期格式化为字符串的类是_________。
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b8-0110-c04c-ee30166b1a01.html
点击查看答案
14. (单选题)下列方法定义中,正确的是( )。
A. int x( ){ char ch='a'; return (int)ch; }
B. void x( ){ ...return true; }
C. int x( ){ ...return true; }
D. int x( int a, b){ return a+b; }
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-6a28-c04c-ee30166b1a04.html
点击查看答案
26. (单选题)关于抽象类的说法错误的是( )。
A. 抽象类中可以有非抽象方法。
B. 父类是抽象类,如果子类不是抽象类,则其必须重写父类所有的抽象方法。
C. 不能用抽象类去创建对象。
D. 接口和抽象类是同一个概念。
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-7db0-c04c-ee30166b1a01.html
点击查看答案
4. (单选题)
设有右边两个类的定义,类Shape和类Rectangle的关系是什么?
class Shape
{ … }
class Rectangle extends Shape
{ … }
A. 包含关系
B. 继承关系
C. 关联关系
D. 无关系,类定义有语法错误
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-9798-c04c-ee30166b1a00.html
点击查看答案
3. (单选题)分析下面程序,第10行语句调用的是( )代码。
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-16b0-c04c-ee30166b1a01.html
点击查看答案
60. (判断题)类中的实例方法可以用类名直接调用。
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-8be0-c04c-ee30166b1a02.html
点击查看答案
16. (单选题)
编译运行以下程序后,关于输出结果的说明正确的是 ( )
public class Conditional{
public static void main( ){
int x=4;
System.out.println("value is "+ ((x>4) ? 99 :9));
}
}
A. 输出结果为:value is 99.9 ;
B. 输出结果为:value is 9
C. 编译错误 ;
D. 输出结果为:value is 99 ;
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-b6d8-c04c-ee30166b1a01.html
点击查看答案
1. (填空题)创建二维数组的语法格式为:数组类型[ ][ ] 数组名=_________;
https://www.shititong.cn/cha-kan/shiti/0005e1b3-7b7a-8968-c04c-ee30166b1a00.html
点击查看答案
23. (单选题)
以下java代码片段,变量temp的值是?
boolean[] array = new boolean[2];
boolean temp = array[1];
A. 2
B. 0
C. false
D. True
https://www.shititong.cn/cha-kan/shiti/0005e1b4-86b7-4590-c04c-ee30166b1a00.html
点击查看答案