Possible Duplicate:
operator overloading and overriding in java
I want to know if it is possible to implement and overwrite the + and ++ operators.
Example:
public class MyClass{
private myIncrement =0; //with its getter and setter
}
.... (another class code)
MyClass myClass = new MyClass();
myClass++;
myClass.getIncrement(); //this will return 1.
And also, if I want to create an Integer class that gives me only multiple of three in a way that when I use i++ on a MultipleOfThree instance it sums three to the current instance instead of sum 1.