奥鹏平台答案吧 关注:42贴子:265
  • 0回复贴,共1

国开电大《Java语言程序设计》形考任务1至4答案

只看楼主收藏回复

国开电大《Java语言程序设计》形考任务1答案
答案:wslm1209
答案:wslm1209
( )提供给上层应用进行开发和构建应用的基础类库。: Java应用; JDK; JVM; JRE
Java程序在编译之后,以( )方式被Java虚拟机执行。: 源代码; 文本; 字节码; 二进制
下列( )移动开发平台使用Java语言作为官方推荐开发语言。: Windows; IOS; Symbian; Android
Java语言中用来编译Java程序的命令是( )。: javaw.exe ; javac.exe; java.exe; javap.exe
下列( )是合法的标识符。: 23667; {printOut}; num_green ; this.commodityPrice
下列( )不是保留字: private; byte ; num_blue; return
下列关于float类型float f=5.2的说法,正确的是( )。: 错误,变量声明错误; 错误,可以考虑使用int类型; 正确 ; 错误,精度不够,需要强制类型转换float
下列代码执行的结果中m和n的值分别为( )。int m = 50, n=160; int tmp =m; m=n; n=tmp: 160/160; 50/50; 50/160 ; 160/50
表达式29/3*3的值是( )。: 27.999 ; 27.0; 29; 27
执行下列语句: int m=15; int val =m- -; val的值是( )。: 14 ; 16; 13; 15
执行下列语句: int m=15; int val =--m; val的值是( )。: 16; 13; 14 ; 15
编译运行以下代码段后,关于输出结果正确的是( )。public class Conditional{ public static void main(String args[ ]){ int x=4; System.out.println(“value is “+ ((x>4) ? 99.9:9)); }}: value is 99.9; value is 9.0; value is 9; 编译错误
下列代码的执行结果是( )。public class Exam1 { public static void main(String[] args) { double var1 = 333; double var2 = 2344; String str = var1 + " / " + var2 + " = "; var2 = var1 / var2; str = str + var2; System.out.println(str); }}: 333.0 / 2344.0 = 0.142; 0.142; 0.14206484641638226; 333.0 / 2344.0 = 0.14206484641638226
下列代码段运行结果为( )。int num = 15;if (num % 2==0) { System.out.println( "num " + num + " is 偶数");} else { System.out.println( "num " + num + "is 奇数");}: "num 15 is 偶数"; 15; 2; "num 15 is 奇数"
下列代码段,m的值为2时会输出( )。public class Test1{  public static void main(String args[]){  int m;  switch(m){  case 0:System.out.println("case 0");break;  case 1:System.out.println("case 1");break;  case 2: break;  default: System.out.println("default");  } }}: 代码编译失败,没有结果输出 ; 没有任何显示 ; "default"; case 0
下列代码段, n处于( )范围时将打印字符串"third" 。if(n>5){ System.out.println("first"); } else if(n<=0){ System.out.println("second"); } else { System.out.println("third"); }: n<=0; n>0&&n<=5; n>5; n<5
下列代码段,执行结果为( )。 int n; for (n=9; n>=3; n--) {System.out.print(n);}: 代码执行成功,输出结果为9876543; 代码编译失败,没有结果输出; 代码执行成功,输出结果为8; 代码执行成功,输出结果为9
下列循环语句实现先执行后判断循环条件的是( )。: do-while; for; while; switch-case
在switch-case语句中,需要与( )语句搭配使用,用以结束对应case逻辑的执行。: if-else; continue; while; break
下列代码段,输出“default”的m的值( )。public class Test1{  public static void main(String args[]){  int m;  switch(m){  case 0:System.out.println("case 0");  case 1:System.out.println("case 1");break;  case 2: break;  default: System.out.println("default");  } }}: 2; 3; 1; 0
下列代码段, x处于( )范围时将打印字符串"second" 。if(x>0){ System.out.println("first"); } else if(x>-3){ System.out.println("second"); } else { System.nut.println("third"); }: x>-3; x<=0&&x>-3; x<=-3; x>0
下列数据类型中,switch语句不能用于的是( )。: char; byte; short; double
类内部内容不包括( )。: 构造方法声明; 属性信息; 外部类的私有方法调用; 方法声明
下列关于类方法的描述,错误的是( )。: 类方法和实例方法均占用内存空间,类方法在未实例化之时,不占用内存空间; 类方法能用实例和类名调用 ; 类方法只能处理类变量或调用类方法; 类方法可使用关键字static作为修饰符
下列( )不是修饰符。: void; final; static ; abstract
下列修饰符( )修饰的变量称为静态变量,修饰的方法称为静态方法。: synchronized; static; native ; abstract
对于下列代码段,说法正确的是( )。public class Student { private String name; private int age; public Student() { this("李红", 25); } public Student(String curName, int curAge) { this.name = curName; age = curAge; } public void setName(String name) { this.name = name; } @override public String toString() { return this.getName() + "," + this.age; } ………}: 通过age 调用了方法age; name 和 age 是两个构造方法的入口参数; 通过this("李红", 25) 调用了构造方法; 通过this.name 调用了方法name
下列修饰符中,可以用来定义类方法和类变量的是( )。: synchronized ; static; final ; native
下列修饰符在修饰类时,类不能直接用来创建实例的是( )。: synchronized; abstract; override; final
下列修饰符在修饰类时,不能被继承扩展的是( )。: native; implements; synchronized ; final
Eclipse目前只支持Windows操作系统,不支持Linux和Macos操作系统。( )
Java的源代码,首先被编译为class文件,然后再被翻译成机器码被目标机器执行。( )
布尔值也可以被强制转化为整数型,true的整型值为0,false为1。( )
一个变量的作用域可以在整个程序段中,即内部代码块和外部代码块中都可以使用。( )
Java语言中注释的语法有三种:单行注释、多行注释和文档注释。( )
逻辑运算符主要用于比较数据之间的大小。( )
break是中断打断的意思,在循环语句中是中断一次执行,然后继续后续的循环。( )
在for语句中,必须设置循环条件,否则程序无法执行。( )
类是典型的体现了面向对象的封装特性,可以隐藏类的内部实现,简化项目的复杂度。( )
面向对象的继承性,可以大大减少类实现中的重复代码。( )


IP属地:湖南1楼2023-05-26 10:53回复