eh3rrera / ocpj8-book

Study guide for the Oracle Certified Professional, Java SE 8 Programmer Exam (1Z0-809)
Other
129 stars 90 forks source link

Code error in Chapter 4 #27

Closed mrizwansarwar closed 7 years ago

mrizwansarwar commented 7 years ago

The following code does not compile due to return type mismatch

interface CompactCar { int accelerate(); } class Car implements CompactCar { @Override public void accelerate() { // implementation } }

eh3rrera commented 7 years ago

Fixed, the implementation must return int instead of void.

Thanks again!

mrizwansarwar commented 7 years ago

The above problem is repeated in the code snippet the appears after this one. I am assuming that the typo that is intended is the difference in method name only but again the return types are different.

eh3rrera commented 7 years ago

Yes, I didn't see it.

It's fixed now, thanks.