Is there an equivalent of the C# property call in java?
protected int foo2{ get; set; }
instead of doing this all the time:
private int foo2;
public void setfoo2 (int value) {foo2 = value;}
public int getfoo2 () {return foo2;}
Is there an equivalent of the C# property call in java?
protected int foo2{ get; set; }
instead of doing this all the time:
private int foo2;
public void setfoo2 (int value) {foo2 = value;}
public int getfoo2 () {return foo2;}
nope.
they are different languages. different ways of doing things. BTW c# too does the same thing in the background. what c# gives is what we call syntactic sugar. it gives a shorthand writing.