This is from a Java 8 thread here. Is there this big a diff between 7 and 8?
"An interface cannot contain an implemented method which affects instance state. An abstract class can. "
An interface can contain implemented methods?
"A concrete implementing class of an interface that declares a default method does not have to provide an implementation for the default method whereas a concrete subclass of an abstract class has to provide an implementation for all the abstract methods in its class hierarchy. "
The first concrete class implementing an interface must implement its methods, no?
" An interface cannot contain an implemented method which affects instance state. An abstract class can. "
I don't think they can, regardless.
"Actually an interface can, but only through methods defined on the interface itself. Map.putIfAbsent is a good example. "
Good, thanks. In that case Associate Certification (OCAJP 7/8) might benefit from being split into two. I thought the differences at this level were just a couple of additions.
Ok, not split into two, but there should be a stick highlighting the differences between the two at the OCAJP test level.
Ashwin Rao wrote:These default methods have to be static?
No. There were two types of methods that were introduced to interfaces in Java 8:
1) Default methods - provide a default implementation so that implementers don't have to (but can) implement the method.
2) Static methods - provide a method you can call directly on the interface without implementing an instance of an implementing class
To be fair, a lot of the things you're linking to weren't up back then, some time last year. Just be careful to carefully distinguish between the two tests and to not let a free service turn into a free disservice.
Guillermo Ishi wrote:To be fair, a lot of the things you're linking to weren't up back then, some time last year.
The mappings between OCA7 and OCA8 exams were added on October 4, 2014 which was after the OCA8 beta exam (released on August 31, 2014) but way before the official release of the OCA8 exam (on January 10, 2015).
And I assume the first step you take when you decide an exam preparation is to read the official certification exam page with the exam objectives. So you know what you need to study to pass the exam. And even during your prepation it's recommended to check the objectives once in a while, because (as you probably know) Oracle can change them whenever they like.