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
69 点赞
1 评论
104 浏览