Question #268022

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.


Expert's answer

No. The program will not compile because constructor Tool in class Tool cannot be applied to given types

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS