摘要: 静态类 静态类与非静态类基本相同,但存在一个区别:静态类不能实例化。 也就是说,不能使用 new 关键字创建静态类类型的变量。 因为没有实例变量,所以要使用类名本身访问静态类的成员。 例如,如果名为 UtilityClass 的静态类有一个名为 MethodA 的公共方法,则按下面的示例所示调用该方法: public class UtilityClass { public static void MethodA() { //// } } class TestCounter { sta... 阅读全文
posted @ 2014-01-14 09:55 aehyok 阅读(3788) 评论(3) 推荐(2) 编辑