You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

What is property in Application Packages ? Also difference between a variable and property ?

1 reply [Last post]
sweety's picture
User offline. Last seen 11 years 8 weeks ago. Offline
Joined: 01/16/2009
Posts: 15

I had read peoplebooks reagarding this topic. I know property is an attribute of an object .But doesnt know where to use bcoz it doesnt perform the role of an object so, cannot be used as an object.Also why GET-SET to be used when we can use a simple variable and play with its values.Here to set values we can use construtor also.Hence the confusion is there in using properties.

Guest's picture
Guest (not verified)
Re: What is property in Application Packages ? Also ...

We have to use GET-SET methods for objects bcoz

as per OOPS concept
private members of an object could be accessed by member methods only(Data hiding), it will not be available to the outsideworld to manipulate.
so the getter & setter methods will be the members of objects. & when ever we need to set the value of an attribute use SET method of that attribute & to get value(for printing,or manipulating) use GET method.