+ only
÷only
+ or × only
- or × only
+, -, ×, ÷
第1题:
与y=(x>0? 1:x<0? -1:0);的功能相同的if语句是
A.if(x>0)y=1 else if(x<0)y=-1; else y=O;
B.if(x) if(x>0)y=1; else if(x<0)y=-1;
C.y=-1; if(x) if(x>0)y=1; else if(x==0)y=0; else y=-1;
D.y=0; if(x>=0) if(x>0)y=1; else y=-1;
第2题:
第3题:
public class X implements Runnable { private int x; private int y; public static void main(String [] args) { X that = new X(); (new Thread( that )).start(); (new Thread( that )).start(); } public void run() { for (;;) { synchronized (this) { x++; y++; } System.out.println(Thread.currentThread().getName() + “x = “ + x + “, y = “ + y); } } } What is the result?()
第4题:
public class X implements Runnable( private int x; private int y; public static void main(Stringargs) X that = new X(); (new Thread(that)).start(); (new Thread(that)).start(); ) public void run() ( for (;;) ( x++; y++; System.out.printIn(“x=” + x + “, y = ” + y); ) ) What is the result?()
第5题:
Compilation fails.
The program prints pairs of values for x and y that might not always be the same on the same line (for example, “x = 2, y = 1”).
The program prints pairs of values for x and y that are always the same on the same line (for example, “x = 1, y = 1”). In addition, each value appears only once (for example, “x = 1, y = 1” followed by “x = 2, y = 2”). The thread name at the start of the line shows that both threads are executing concurrently.
The program prints pairs of values for x and y that are always the same on the same line (for example, “x = 1, y = 1”). In addition, each value appears only once (for example, “x = 1, y = 1” followed by “x = 2, y = 2”). The thread name at the start of the line shows that only a single thread is actually executing.
第6题:
Errors at lines 7 and 8 cause compilation to fail.
The program prints pairs of values for x and y that might not always be the same on the same line (for example, “x=2, y=1”).
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by “x=1, y=1”).
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears only for once (for example, “x=1, y=1” followed by “x=2, y=2”).
第7题:
x+y=5
x - y = 1
3x-2y = 10
x2 -y=5
x +y2 = 7
第8题:
(x-1)/(y-1)
y/(x-1)
(x+1)/y
(x-y)/(x+y)
y/(x+1)
第9题:
×only
+only
-only
-and×
+and÷
第10题:
An error at line 11 causes compilation to fail.
Errors at lines 7 and 8 cause compilation to fail.
The program prints pairs of values for x and y that might not always be the same on the same line (for example, “x=2, y=1”)
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by “x=1, y=1”)
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by “x=2s, y=2”)
第11题:
Five
Six
Seven
Eight
Nine
第12题:
第13题:
与y=(x>0?1:x<0?-1:0):的功能相同的if语句是( )
A.if(x>0)y=1; else if(x<0)y=-1; else y=0; else y=0;
B.if(x) if(x>0)y=1; else if(x<0)y=-1;
C.y=-1; if(x) if(x>0)y=1; else if(x==0)y=0; else y=-1;
D.y=0; if(x>=0) if(x>0)y=1; else y=-1:
第14题:
1. public class X implements Runnable( 2. private int x; 3. private int y; 4. 5. public static void main(String[]args) 6. X that = new X(); 7. (new Thread(that)).start(); 8. (new Thread(that)).start(); 9. ) 10. 11. public void run() ( 12. for (;;) ( 13. x++; 14. y++; 15. System.out.printIn(“x=” + x + “, y = ” + y); 16. ) 17. ) What is the result?()
第15题:
public class X implements Runnable ( private int x; private int y; public static void main(String args) ( X that = new X(); (new Thread(that)) . start( ); (new Thread(that)) . start( ); ) public synchronized void run( ) ( for (;;) ( x++; y++; System.out.printIn(“x = “ + x + “, y = “ + y); ) ) ) What is the result?()
第16题:
xy
(x+1)y
x(y+1)
第17题:
-2<a+b<-1
-l<a+b<0
0<a+b<l
l<a+b<2
2<a+b<3
第18题:
Errors at lines 7 and 8 cause compilation to fail.
The program prints pairs of values for x and y that might not always be the same on the same line (for example, “x=2, y=1”).
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by “x=1, y=1”).
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears only for once (for example, “x=1, y=1” followed by “x=2, y=2”).
第19题:
c1y1+c2y2
c1Y1(x)+c2Y2(x)
c1y1+c2y2+Y1(x)
c1y1+c2y2+Y1(x)+Y2(x)
第20题:
0.5
0.6
0.7
0.8
0.9
第21题:
0.25x + 0.10y + 0.05z
2.5x + 1. 0y + 0.5z
25x + 10y + 5z
0.25x + 0.10y + 0.5z
25x + 10y + 50z
第22题:
Ⅰ only
Ⅱ only
Ⅲ only
Ⅰ and Ⅲ only
Ⅱ and Ⅲ only
第23题:
I
I and II
I and III
II and III