KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
class Dad { protected static String me = "dad"; public void printMe() { System.out.println(me); } } class Son extends Dad { protected static String me = "son"; } public void doIt() { new Son().printMe(); } The function doIt will print "dad". Is there a way to make it print "son"?
Tags (comma-separated)
Save Edits
Cancel