Created
August 22, 2012 00:43
-
-
Save mailtoharshit/3420953 to your computer and use it in GitHub Desktop.
Property
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Integer cost; | |
public Integer getcost() { return cost; } | |
public void setcost(Integer cost) { this.cost=cost; } | |
// Variable as Property | |
public Integer cost { get { return cost; } set { this.cost= cost;}} | |
//Variable as Automatic Property | |
public Integer cost { get; set; } | |
//read-only and write - only Property | |
public Integer readOnly { get; private set;} | |
public Integer wrtieOnly { private get; set;} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment