摘要:
有两种方法,递归和for循环 package com.hm.demo01; public class Test { public static void main(String[] args) { long result=func(10); System.out.println(result); } 阅读全文
摘要:
final类 final方法 常量 package com.demo34; public class A { //若类被声明为final类,不可以被继承 final double PI=3.1415926; public double getArea(final double r) { //成员变量 阅读全文
摘要:
成员变量有默认值,而局部变量是没有默认值的 package com.demo20; public class InitError { int x=10; int y; void f() { int m; x=y+m;////报错:The local variable m may not have b 阅读全文