class FunctionDemo2
{
public static void main(String[] args)
{
int sum = getSum();
System.out.println("sum="+sum);
public static int getSum()
{
return 3+4;
}
class FunctionDemo2
{
public static void main(String[] args)
{
int sum = getSum();
System.out.println("sum="+sum);
}
public static int getSum()
{
return 3+4;
}
这回我在输出语句后面多加了个括号就OK了。