Ultra java noob 在这里,我敢肯定它可能是一个愚蠢的错误。有人关心纠正我吗?
public class Test1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int n = 4;
public void f(int n){
System.out.print(n);
if(n<=1)
return;
else{
f(n/2);
f(n/2);
}
}
}
我收到此错误:
Exception in thread "main" java.lang.RuntimeException:
Uncompilable source code - illegal start of expression at the
public void f(int n)