Set custom class object's value with '=' operator in Java
I have a custom object that has a single value of type int that I wanting
to do processing on to keep this value in a set range. My question is
this: Given the following class, can I set it's value with myObject = 0;
public class foo{
private int bar;
public foo(){
}
}
Instead of creating a method public void setBar()
No comments:
Post a Comment