Java beans are java classes that have propertied- Private variables are accessed outside their class through methods in the class
- Methods that change hte property value through-setter method
and retrieve the property’s value through -getter method
setter() method
|
getter() method
|
Signatures are public
|
Signatures are public
|
arguement that represents property type
|
take no arguments
|
return type: void
|
have return type which matches the argument type of setter method
|
Ex: public void setMyValue(int v)
|
Ex: public int getMyValue()
|
bare-bones class declaration
class MyClass{}
Access Modifiers are used with this
No comments:
Post a Comment