-- FIRST OF ALL WHY IS THIS A LEGAL IMPLEMENTATION OF THE interface it doesn't implement the eat() method.
because the class is defined as abstract. So it isn't required to implement any of the interface methods. That is still going to be the responsibility of any class that extends the abstract class and is not abstract itself.
Whis is the { x += x; } part of this code snippet legal???
Not a great answer, but because it is the "+=" is a legal operator/assigner. And you know x = x; is a legal assignment.
Usually x += x; is equivalent to x = x + x.
You should try it and see what the results are. Do a simple class that in the main takes int x = 1; then x += x; and see what x is after that statement.
But besides that, there is much more going on in that code besides the assignment. Like where is this code, what method, etc...
Mark
[ July 13, 2005: Message edited by: Mark Spritzler ]
[ July 13, 2005: Message edited by: Mark Spritzler ]