欢迎来到牛牛题库网 牛牛题库官网
logo
全部科目 > Java认证考试 > Java认证考试综合练习

单项选择题

现有: 
class Banana2  f     
static int X=2; 
public static void main (String  []  args)  {    
int X=2;  
Banana2 b=new Banana2();    
b.go(x);    
} 
static  {x+=x; }  
void go (int x)  {   
++x; 
System. out.println (x);   
}        
结果为:()    

A.7
B.5
C.3
D.2

点击查看答案&解析

相关考题

单项选择题
我们定义一个Account类来描述银行账户,银行账户有账户名、金额等属性特征,同时有存款、取款等行为特征,下述代码适合描述的是哪项?()     

A.class  Accountf        String name;//账户     S    tring amount;  //金额        Account (String name)(    )   void deposit (double mount){  //存款     )   void withdraw (double mount){  //取款     }     )
B.class  Accountf       String name;//账户d  ouole amount;  //金额       Account(double amount){   }  void deposit (double mount){  //存款     )  void withdraw (double mount){  //取款     )     )
C.class  Accountf        String name;//账户   double amount;  //金额       Account (String name){}    void deposit (double mount){//存款     )      void withdraw (double mount){  //取款     )     )
D.class Accountf        String name;//账户        double amount;//金额      Account (String name){}        void deposit(){//存款     )   void withdraw(){//取款 )     )

微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题