问题 单项选择题

已知有下列类的说明,则下列哪个语句是正确的    public class Test{      private float f = 1.0f;      int m = 12;      static int n=1;      public static void main(String arg[ ]){        Test t = new Test( );      }    }

A.f;

B.thin;

C.Tesm;

D.Tesf;

答案

参考答案:A

解析:解析:此题主要考查对象的正确使用,其格式为对象名.调用的方法名或 变量名。在static方法中,不能使用this。变量m和f都不是静态成员,所以不能用类名. 成员方式访问。

单项选择题 案例分析题
单项选择题