black

SCJP程序员认证考试

登录

单项选择题

What will be the result of attempting to compile and run the following code?()  
public class Q6b0c {  
public static void main(String args[]) { 
int i = 4; 
float f = 4.3;  
double d = 1.8;  
int c = 0;  
if (i == f) c++;  
if (((int) (f + d)) == ((int) f + (int) d))
 c += 2; 
 System.out.println(c); 
 }  
}  

A.The code will fail to compile.
B.0 will be written to the standard output.
C.1 will be written to the standard output.
D.2 will be written to the standard output.
E.3 will be written to the standard output.

相关考题

多项选择题 Whichstatementsconcerningthecorrelationbetweentheinnerandouterinstancesofnon-staticinnerclassesaretrue?()

多项选择题 Whichstatementsconcerningthemethodsnotify()andnotifyAll()aretrue?

多项选择题 Given the following interface definition, which definitions are valid?()   interface I {   void setValue(int val);   int getValue();   }    DEFINITION a:   (a) class a extends I {  int value;   void setValue(int val) { value = val;  }   int getValue() {  return value;  }   }   DEFINITION b:   (b) interface b extends I {   void increment();   }   DEFINITION c:   (c) abstract class c implements I {   int getValue() {  return 0;  }  abstract void increment();   }   DEFINITION d:   (d) interface d implements I {  void increment();  }   DEFINITION e:   (e) class e implements I {  int value;   public void setValue(int val) { value = val; }  }

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3