【发布时间】:2013-10-17 06:03:48
【问题描述】:
package com.testo.project1;
public class mathe {
static int zahl1;
static int zahl2;
static int erg;
public static void main(String[] args) {
add(5,4);
}
public static void add(){
zahl1 = this.zahl1;
zahl2 = this.zahl2;
erg=zahl1+zahl2;
System.out.println(erg);
}
}
为什么这段代码不起作用? 我调用该方法时有 2 个整数。 方法需要对象吗??
【问题讨论】:
-
您已声明该方法采用零参数...