假设我有这个代码。使用 ClassA 的实例时,如何将类的实例传递给方法methodA?public class ClassA { public static int methodA(ClassA class) { return 1; }}//This is wrong but this is what I'm trying to dopublic class Main { public static void main(String [] args) { ClassA classa = new ClassA(); classa.methodA(classa); }}
添加回答
举报
0/150
提交
取消