在类Telphone属性设置为public screen中,在main方法中写成对象名.属性()即hello2.screen=6.0f是对screen赋值,能输出结果;但是写成hello2.screen(6.0f)就不对,显示错误,请问这是什么原因,这两者有什么区别?
大家讲道理2017-04-18 10:52:36
For variables, the equal sign is an assignment operation. The following writing method is to call a method called screen with a float parameter. Of course, if you don’t have this method, an error will be reported.