网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
1. public class ArrayTest { 2. public static void main (String[]args) { 3. float f1[], f2[]; 4. f1 = new float [10]; 5. f2 = f1; 6. System.out.printIn (“f2[0]=” + f2[0]); 7. } 8. } What is the result?()
- A、 It prints f2[0] = 0.0
- B、 It prints f2[0] = NaN
- C、 An error at line 5 causes compile to fail.
- D、 An error at line 6 causes compile to fail.
- E、 An error at line 6 causes an exception at runtime.
参考答案
更多 “ 1. public class ArrayTest { 2. public static void main (String[]args) { 3. float f1[], f2[]; 4. f1 = new float [10]; 5. f2 = f1; 6. System.out.printIn (“f2[0]=” + f2[0]); 7. } 8. } What is the result?() A、 It prints f2[0] = 0.0B、 It prints f2[0] = NaNC、 An error at line 5 causes compile to fail.D、 An error at line 6 causes compile to fail.E、 An error at line 6 causes an exception at runtime.” 相关考题
考题
有以下程序#include stdio.hmain(){ int f,f1,f2,i;f1=0;f2=1;printf("%d %d ",f1,f2);for(i=3;i=5;i++){ f=f1+f2; printf("%d",f);f1=f2; f2=f;}printf("\n");}程序运行后的输出结果是 【 1 0 】 。
考题
有如下程序: include using namespace std; class base { public:virtual void f1(){
有如下程序: #include<iostream> using namespace std; class base { public: virtual void f1() { cout<<"F1Base"; } virtual void f2() { cout<<"F2Base "; } }; class derive : public base { void f1 ( ) { cout<<"F1Derive"; } void f2( int x ) { cout<<"F2 Derive"; } }; int main () { base objl, * p; derive obj2; p = obj2; p -> f1(); p -> f2(); return 0; } 执行后的输出结果是( )。A.F1Derive F2BaseB.F1Derive F2DeriveC.F1Base F2BaseD.F1Base F2Derive
考题
publicclassArrayTest{2.publicstaticvoidmain(String[]args){3.floatf1[],f2[];4.f1=newfloat[10];5.f2=f1;6.System.out.printIn(f2[0]=”+f2[0]);7.}8.}Whatistheresult?()
A.Itprintsf2[0]=0.0B.Itprintsf2[0]=NaNC.Anerroratline5causescompiletofail.D.Anerroratline6causescompiletofail.E.Anerroratline6causesanexceptionatruntime.
考题
publicclassArrayTest{publicstaticvoidmain(String[]args){floatfl[],f2[];fl=newfloat[10];f2=f1;System.out.println(f2[0]=+f2[0]);}}Whatistheresult?()
A.Itprintsf2[0]=0.0.B.Itprintsf2[0]=NaN.C.Anerroratline5causescompiletofail.D.Anerroratline6causescompiletofail.E.Anerroratline6causesanexpectationatruntime.
考题
publicclassArrayTest{publicstaticvoidmain(Stringargs){floatf1,f2;f1=newfloat[10];f2=f1;System.out.printIn(f2[0]=”+f2[0]);}}Whatistheresult?()
A.Itprintsf2[0]=0.0B.Itprintsf2[0]=NaNC.Anerroratline5causescompiletofail.D.Anerroratline6causescompiletofail.E.Anerroratline6causesanexceptionatruntime.
考题
C 程序写运行结果。class A{public:void f1(){printf("A::f1\r\n");}virtual void f2(){printf("A::f2\r\n");}void callfunc(){printf("A::callfunc\r\n");f1();f2();}};class B :public A{public:void f1(){printf("B::f1\r\n");}void f2(){printf("B::f2\r\n");}void callfunc(){printf("B::callfunc\r\n");f1();f2();}};int main(){B *pB=new B;pB-callfunc();A *pA=pB;pA-callfunc();return 0;}
考题
有如下程序includeusing namespace std;class base{public:virtual void f1(){cout
有如下程序 #include<iostream> using namespace std; class base { public: virtual void f1() { cout<<"F1Base"; } virtual void f2() { cout<<"F2Base"; } }; class derive:public base { void f1() { cout<<"F1 Derive"; } void f2(int x) { cout<<"F2 Derive"; } }; int main() { base obj1,*p; derive obj2; p= obj2; p->f1(); p->f2(); return (); ) 执行后的输出结果是( )。A.F1Derive F2BaseB.F1Derive F2DeriveC.F1Base F2BaseD.F1Base F2Derive
考题
有如下程序includeusing nameSpace std;class base{public:vinual void f1() { cout
有如下程序 #include<iostream> using nameSpace std; class base { public: vinual void f1() { cout<<"F1 Base"; } virtual void f2() { cout<<"F2Base"; } }; class derive:public base { void f1() { cout<<"F1Derive"; } void f2(int x) { cout<<"F2Derive"; } }; int main() { base obj1,*p; derive obj2; p=obj2; p—>f1(); p—>f2(); return 0; } 执行后的输出结果是A.F1Derive F2BaseB.F1Derive F2DeriveC.F1Base F2BaseD.F1Base F2Derive
考题
以下程序的输出结果是( )。 include void main() {int f,f1,f2,i; f1=0;f2=1; printf("%
以下程序的输出结果是( )。 include<stdio.h> void main() {int f,f1,f2,i; f1=0;f2=1; printf("%d%d",f1,f2); for(i=3;i<=5;i++) {f=-f1+f2,printf("%d",f); f2=f1;f1=f; } printf("\n"); }
考题
public class ArrayTest { public static void main (Stringargs) { float f1, f2; f1 = new float [10]; f2 = f1; System.out.printIn (“f2[0]=” + f2[0]); } } What is the result?()A、 It prints f2[0] = 0.0B、 It prints f2[0] = NaNC、 An error at line 5 causes compile to fail.D、 An error at line 6 causes compile to fail.E、 An error at line 6 causes an exception at runtime.
考题
public class ArrayTest { public static void main(String[] args) { float fl[], f2[]; fl = new float[10]; f2 = f1; System.out.println(“f2[0]= “ + f2[0]); } } What is the result?() A、 It prints f2[0] = 0.0.B、 It prints f2[0] = NaN.C、 An error at line 5 causes compile to fail.D、 An error at line 6 causes compile to fail.E、 An error at line 6 causes an expectation at runtime.
考题
1. public class A { 2. void A() { 3. System.out.println(“Class A”); 4. } 5. public static void main(String[] args) { 6. new A(); 7. } 8. } What is the result?() A、 Class AB、 Compilation fails.C、 An exception is thrown at line 2.D、 An exception is thrown at line 6.E、 The code executes with no output.
考题
1. public class X { 2. public static void main (String[]args) { 3. int [] a = new int [1] 4. modify(a); 5. System.out.printIn(a[0]); 6. } 7. 8. public static void modify (int[] a) { 9. a[0] ++; 10. } 11. } What is the result?()A、 The program runs and prints “0”B、 The program runs and prints “1”C、 The program runs but aborts with an exception.D、 An error “possible undefined variable” at line 4 causes compilation to fail.E、 An error “possible undefined variable” at line 9 causes compilation to fail.
考题
1. public class ForBar { 2. public static void main(String []args) { 3. int i = 0, j = 5; 4. tp: for (;;) { 5. i ++; 6. for(;;) 7. if(i --j) break tp; 8. } 9. system.out.printIn(“i = ” + i + “, j = “+ j); 10. } 11. } What is the result?() A、 The program runs and prints “i=1, j=0”B、 The program runs and prints “i=1, j=4”C、 The program runs and prints “i=3, j=4”D、 The program runs and prints “i=3, j=0”E、 An error at line 4 causes compilation to fail.F、 An error at line 7 causes compilation to fail.
考题
public class Test { private static float[] f = new float[2]; public static void main(String args[]) { System.out.println(“f[0] = “ + f[0]); } } What is the result?() A、 f[0] = 0B、 f[0] = 0.0C、 Compilation fails.D、 An exception is thrown at runtime.
考题
Iff1(t)←→F1(jω),f2(t)←→F2(jω),Then()A、f1(t)*f2(t)←→F1(jω)F2(jω)B、f1(t)+f2(t)←→F1(jω)F2(jω)C、f1(t)f2(t)←→F1(jω)F2(jω)D、f1(t)/f2(t)←→F1(jω)/F2(jω)
考题
public class test ( private static int j = 0; private static boolean methodB(int k) ( j += k; return true; ) public static void methodA(int i)( boolean b: b = i 10 | methodB (4); b = i 10 || methodB (8); ) public static void main (String args[])( methodA (0); system.out.printIn(j); ) ) What is the result?() A、 The program prints “0”B、 The program prints “4”C、 The program prints “8”D、 The program prints “12”E、 The code does not complete.
考题
public class test { public static void add3 (Integer i){ int val = i.intValue ( ); val += 3; i = new Integer (val); } public static void main (String args [ ] ) { Integer i = new Integer (0); add3 (i); system.out.printIn (i.intValue ( ) ); } } What is the result?()A、 Compilation will fail.B、 The program prints “0”.C、 The program prints “3”.D、 Compilation will succeed but an exception will be thrown at line 3.
考题
单选题有以下程序:#include main(){ int x[]={8,2,6,12,5,15},f1,f2; int *p=x; f1=f2=x[0]; for(;p { if(f1 if(f2*p)f2=*p; } printf("%d,%d",f1,f2);}程序的运行结果是( )。A
15,2B
15,15C
2,15D
8,8
考题
单选题1. public class X { 2. public static void main (String[]args) { 3. int [] a = new int [1] 4. modify(a); 5. System.out.printIn(a[0]); 6. } 7. 8. public static void modify (int[] a) { 9. a[0] ++; 10. } 11. } What is the result?()A
The program runs and prints “0”B
The program runs and prints “1”C
The program runs but aborts with an exception.D
An error “possible undefined variable” at line 4 causes compilation to fail.E
An error “possible undefined variable” at line 9 causes compilation to fail.
考题
单选题public class ArrayTest { public static void main(String[] args) { float fl[], f2[]; fl = new float[10]; f2 = f1; System.out.println(“f2[0]= “ + f2[0]); } } What is the result?()A
It prints f2[0] = 0.0.B
It prints f2[0] = NaN.C
An error at line 5 causes compile to fail.D
An error at line 6 causes compile to fail.E
An error at line 6 causes an expectation at runtime.
考题
单选题1. public class ArrayTest { 2. public static void main (String[]args) { 3. float f1[], f2[]; 4. f1 = new float [10]; 5. f2 = f1; 6. System.out.printIn (“f2[0]=” + f2[0]); 7. } 8. } What is the result?()A
It prints f2[0] = 0.0B
It prints f2[0] = NaNC
An error at line 5 causes compile to fail.D
An error at line 6 causes compile to fail.E
An error at line 6 causes an exception at runtime.
考题
单选题public class test { public static void add3 (Integer i) int val = i.intValue ( ); val += 3; i = new Integer (val); } public static void main (String args [ ] ) { Integer i = new Integer (0); add3 (i); system.out.printIn (i.intValue ( ) ); } What is the result?()A
Compilation will fail.B
The program prints “0”.C
The program prints “3”.D
Compilation will succeed but an exception will be thrown at line 3.
考题
单选题设f1(x),f2(x)是二阶线性齐次方程y″+p(x)y′+q(x)y=0的两个特解,则c1f1(x)+c2f2(x)(c1,c2是任意常数)是该方程的通解的充要条件为( )。A
f1(x)f2′(x)-f2(x)f1′(x)=0B
f1(x)f2′(x)+f1′(x)f2(x)=0C
f1(x)f2′(x)-f1′(x)f2(x)≠0D
f1′(x)f2(x)+f2(x)f1(x)≠0
考题
单选题public class test ( private static int j = 0; private static boolean methodB(int k) ( j += k; return true; ) public static void methodA(int i)( boolean b: b = i 10 | methodB (4); b = i 10 || methodB (8); ) public static void main (String args[])( methodA (0); system.out.printIn(j); ) ) What is the result?()A
The program prints “0”B
The program prints “4”C
The program prints “8”D
The program prints “12”E
The code does not complete.
考题
单选题public class ArrayTest { public static void main (Stringargs) { float f1, f2; f1 = new float [10]; f2 = f1; System.out.printIn (“f2[0]=” + f2[0]); } } What is the result?()A
It prints f2[0] = 0.0B
It prints f2[0] = NaNC
An error at line 5 causes compile to fail.D
An error at line 6 causes compile to fail.E
An error at line 6 causes an exception at runtime.
热门标签
最新试卷