初学代码的时候,一直不懂get和set的问题。不知道什么时候加get方法和set方法。也不知道为什么用get和set的方法。
收起
get,set就是为了封装变量,get用来读,set用来写
报告相同问题?