以下文字与答案无关
提示:有些试题内容 显示不完整,文字错误 或者 答案显示错误等问题,这是由于我们在扫描录入过程中 机器识别错误导致,人工逐条矫正总有遗漏,所以恳请 广大网友理解。
定义类 A 和类 B 如下,得到结果是( )
classA{
intx;
A(int i){x=i;}
}
classBextendsA{
doubleb=5.5; }
选项: A:代码能够成功编译运行。
B:代码无法编译,因为类 B 不是一个应用程序。
C:代码无法编译,因为类 B 没有定义一个不带参数的构造方法。
D:代码无法编译,因为类 A 没有定义一个不带参数的构造方法
public void methodTwo(int i){}
C:public static void methodTree(int i, int j){}
D:blic static void methodFour(int i){}
">8.以下哪个方法不可以加入类 Son? ( )
class Father{
public void methodOne(int i){}
public void methodTwo(int i){}
public static void methodTree(int i){}
public static void methodFour(int i){}
}
class Son extends Father{…}
选项: A:public static void methodOne(int i){}
B:public void methodTwo(int i){}
C:public static void methodTree(int i, int j){}
D:blic static void methodFour(int i){}
abstract class A {
abstract float getFloat (); //1
void f() //2
{ }
}
public class B extends A {
private float m = 1.0f; //3
private float getFloat () //4
{ return m;
}
}
选项: A:1
B:2
C:3
D:4
span
pclass="notMyClass"
pclass="notMyClass"
jQuery 代码 : $("div,span,p.myClass") 结果 :">10.HTML 代码 :
span
pclass="notMyClass"
pclass="notMyClass"
jQuery 代码 : $("div,span,p.myClass") 结果 :true
B、false
p class="notMyClass"
jQuery 代码: $("div,span,p.myClass") 结果:( ) 选项:A、[p class="myClass"
, span ] B、[p class="myClass"
] C、[p class="notMyClass"
] D、[p class="myClass"
spanp class="notMyClass"
jQuery 代码: $("div,span,p.myClass") 结果:( ) 选项:A、[p class="myClass"
, span ] B、[p class="myClass"
] C、[p class="notMyClass"
] D、[词法分析
B:目标代码
C:语法分析
D:语义分析
P
] D、[P
] ">14.HTML 代码:P
jQuery 代码: $("*") 结果:( ) 选项:A、[P
] D、[P
]第十行 f=f+step ;
第十一行 }
第十二行 return 0;
第十三行}
第8行代码: c = 5.0 / 9 * (f - 32)
第10行代码: f = f - step
第8行代码: c = 5.0 / (9 * (f - 32))
第10行代码: f = f + step
第8行代码: c = 5 / 9 * (f - 32)
第10行代码: c = c + step
第8行代码: c = 5.0 / 9 * (f - 32)
第10行代码: f = f + step
选项: A:第8行代码: c = 5.0 / 9 * (f - 32)
第10行代码: f = f - step
B:第8行代码: c = 5.0 / (9 * (f - 32))
第10行代码: f = f + step
C:第8行代码: c = 5 / 9 * (f - 32)
第10行代码: c = c + step
D:第8行代码: c = 5.0 / 9 * (f - 32)
第10行代码: f = f + step
">15.华氏和摄氏温度的转换公式为C=5/9×(F-32)。式中,C表示摄氏温度,F表示华氏温度。要求:华氏0℉~300℉,每隔20℉输出一个华氏温度对应的摄氏温度值。按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。:#include
第行int main()
第行{
第四行 int upper = 300, step = 20;
第行 float f = 0, c;
第六行 while (f < upper)
第七行 {
第八行 c=5.0/9*(f-32);
第九行 printf("%4.0f\t%6.1f\n", f ,c);
第十行 f=f+step ;
第十一行 }
第十二行 return 0;
第十三行}
第8行代码: c = 5.0 / 9 * (f - 32)
第10行代码: f = f - step
第8行代码: c = 5.0 / (9 * (f - 32))
第10行代码: f = f + step
第8行代码: c = 5 / 9 * (f - 32)
第10行代码: c = c + step
第8行代码: c = 5.0 / 9 * (f - 32)
第10行代码: f = f + step
选项: A:第8行代码: c = 5.0 / 9 * (f - 32)
第10行代码: f = f - step
B:第8行代码: c = 5.0 / (9 * (f - 32))
第10行代码: f = f + step
C:第8行代码: c = 5 / 9 * (f - 32)
第10行代码: c = c + step
D:第8行代码: c = 5.0 / 9 * (f - 32)
第10行代码: f = f + step
P
] D:[P
]">16.HTML 代码:P
jQuery 代码: $("*") 结果:( ) 选项: A:[P
] D:[P
]javac
B:java
C:javadoc
D:jdk
byte ] a="abcd".getBytes();
try{ FileOutputStream out=new FileOutputStream(f);
out.write(a);
out.close();
FileInputStream in=new FileInputStream(f);
byte ] tom= new byte3];
int m = in.read(tom,0,3);
System.out.println(m); //【代码1】
String s=new String(tom,0,3);
System.out.println(s); //【代码2】
m = in.read(tom,0,3);
System.out.println(m); //【代码3】
s=new String(tom,0,3);
System.out.println(s); //【代码4】
}
catch(IOException e) {}
}
}
">19.上机调试题:请说出E类中标注的【代码1】~【代码4】的输出结果。
import java.io.*;
public class E {
public static void main(String args]) {
int n=-1;
File f =new File("hello.txt");
byte ] a="abcd".getBytes();
try{ FileOutputStream out=new FileOutputStream(f);
out.write(a);
out.close();
FileInputStream in=new FileInputStream(f);
byte ] tom= new byte3];
int m = in.read(tom,0,3);
System.out.println(m); //【代码1】
String s=new String(tom,0,3);
System.out.println(s); //【代码2】
m = in.read(tom,0,3);
System.out.println(m); //【代码3】
s=new String(tom,0,3);
System.out.println(s); //【代码4】
}
catch(IOException e) {}
}
}
java
B:class
C:html
D:exe
import java.io.*;
public class E {
public static void main(String args]) {
int n=-1;
File f =new File("hello.txt");
byte ] a="abcd".getBytes();
try{ FileOutputStream out=new FileOutputStream(f);
out.write(a);
out.close();
FileInputStream in=new FileInputStream(f);
byte ] tom= new byte3];
int m = in.read(tom,0,3);
System.out.println(m); //【代码1】
String s=new String(tom,0,3);
System.out.println(s); //【代码2】
m = in.read(tom,0,3);
System.out.println(m); //【代码3】
s=new String(tom,0,3);
System.out.println(s); //【代码4】
}
catch(IOException e) {}
}
}(2.0分)
Double d=84.54;
D++;
Int c=d/2;
选项: A:42
B:编译错误,更改为int c=(int)d/2;
C:43
D:编译错误,更改为int c=int(d)/2;
double d=84.54;
d++;
Int c=d/2;
选项: A:42
B:编译错误,更改为int c=(int)d/2
C:43
D:编译错误,更改为int c=int(d)/2
double d = 84.54;
d++;
int c = d/2;
选项: A:42
B:编译错误,更改为intc=(int)d/2;
C:43
D:编译错误,更改为intc=int/2;