假设我有这个代码。使用 ClassA 的实例时,如何将类的实例传递给方法methodA?
public class ClassA {
public static int methodA(ClassA class) {
return 1;
}
}
//This is wrong but this is what I'm trying to do
public class Main {
public static void main(String [] args) {
ClassA classa = new ClassA();
classa.methodA(classa);
}
}
米脂
炎炎设计
相关分类