public class MYClass{ long var; public void MYClass(long parm){var = parm;}public static void main(String [] args){MYClass a , b;a =new MYClass();b= new MYClass(5);//错误 }}注意,构造函数的定义应该是public MYClass(long parm){var = parm;}而上面的void MYCla...
牛客网
2024-10-23
43 点赞
0 评论
65 浏览