keyword here? its used because the local variable name and instance variable names are same or to is it working like Point2D.x = x; and Point3D.y = y; ?
this means instance of that class.
So the x and y which user passes are stored in the variables of instance of that class.
will it not store if we write x = x; and y = y; ?
This will take x as the variable name that u got from the constructor
Btw make it private and can use getter setters
sorry to bother. but will using same variable names in parameters not cause any problem?
No u just have to return a value
hey how do i return the value? when i do return x; or return this.x; in parameterized constructor of Point3D class. it gives error: incompatible types: unexpected return value
Обсуждают сегодня