private and public are the modifier which specify the scope of the members of the class. if the member data is decleared with public, then all instance can access it no matter what package it is in. if it is the private, it can only be accessed in the same package. the dafult is private.
return means the method ended and the value after return can be gotten by the method called. such as if you call
double returnVal = A.volum(). then the value of returnVal is the same as v. that mean we assign the value of v to returnVal.
return means the method ended and the value after return can be gotten by the method called. such as if you call
double returnVal = A.volum(). then the value of returnVal is the same as v. that mean we assign the value of v to returnVal.
2返回一个值
return代表这个方法运行后所返回的值