摘要: 1、通过内部类调用外部类中的私有属性 2、用static声明的内部类变成了外部类,但是用static声明的内部类不能访问非static的外部类属性: 3、在方法中定义内部类:在方法中定义的内部类不能直接访问方法中的参数,如果方法中的参数想要被内部类访问,则参数前面必须加上final关键字: 阅读全文
posted @ 2017-07-26 23:11 XuGuobao 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 1 public class Test01 { 2 3 public static void main(String[] args) { 4 int[] a = new int[101]; 5 int i,j; 6 for(i=1;i<101;i++){ 7 a[i] = i; 8 ... 阅读全文
posted @ 2017-07-26 20:31 XuGuobao 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 1、有一个整数n,写出一个函数f(n),返回0~n之间出现的“1”的个数。比如f(1)=1; f(13) = 6,(1,10,11,12,13总共含有6个1)。问满足f(n)=n的n是多少? 输出结果为199981 阅读全文
posted @ 2017-07-26 17:25 XuGuobao 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 输出结果为: 124 阅读全文
posted @ 2017-07-26 11:56 XuGuobao 阅读(289) 评论(0) 推荐(0) 编辑