Answer to Question #268022 in Java | JSP | JSF for Candy

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.


1
Expert's answer
2021-11-22T07:08:42-0500
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS