1) Compile time error, an abstract class cannot have non abstract methods. 2) Compile time error, the equals method of the String class takes a String parameter not a StringBuffer 3) Compile time error, class Ilea does not implement the getLeader method of Lcc 4) Compilation and output of "equals" 5) Compilation, but no output at runtime
Sure, there's nothing wrong with any of the code and so it compiles and runs and the comparison fails. A StringBuffer will never equal a String, no matter what the content of each is. That's part of the canonical equals() contract.