class Tool {
private String name = "B tool"; public Tool(String name)
{
this.name = name; }
}
class Hammer extends Tool {
// Suppose Crackable interface exists public void crack(Crackable b)
{
// implementation to crack object b}
}
Will it compile? YES or NO. Give reason, if No.
No. The program will not compile because constructor Tool in class Tool cannot be applied to given types
Comments
Leave a comment