1.class Happy {
2. public static void main(String args[]) {
3. int x=4;
4. int y=2;
5. if(x/y) {
6. System.out.println(x+y);
7. }
8. }
9.}
What is the output?
a) prints 6
b) compilation error at line no.6
c) compilation error at line no.5
d) runtime exception occurs
e) prints 4
解析如下:
这个题目考查的是对if...else语句的理解程度
因为if...else 是条件判断语句。所以是boolean type
Therefore,this issue is the result of:
C