You don't see it?!? Have you looked?

As a self-professed Java bigot, I will readily admit that C# has a
*way* better sytax for defining and using properties that I wish Java
would implement (or even better - improve upon).

public string MyProperty {
        get { return myProperty; }
        set { myProperty = value; }
}

Now, instead of: 

someValue = foo.getMyProperty();
foo.setMyProperty(someValue);

...I can do this instead:

someValue = foo.MyProperty;
foo.MyProperty = someValue;

IMO, the second form is MUCH clearer, and provides all of the benefits
of a get/set pair.

Larry


On 8/5/05, Leon Rosenberg <[EMAIL PROTECTED]> wrote:
> 
> Sorry, I don't see it.
> 
> Example:
> private String mail;
> public String getMail(){
> return mail;
> }
> 
> public void setMail(String aMail){
> mail = aMail;
> }
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to