This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Well, of course, you can call it on an instance of SuperParent -- i.e., nothing stops you from doing this in Child.main():
SuperParent sp = new SuperParent(); sp.printMessage();
But I suspect what you're asking is whether there's any way for an instance of Child to invoke SuperParent's printMessage() on itself. The answer is no -- Java simply doesn't allow it, so don't waste any energy trying to figure out a way!
Hi Ernest Friedman, My question is if i want to call SuperParent method printMessage() without creating it's Object. we can call super.printMessage(), it will give you output "Parent". So there is any way to call SuperParent Class from the Child without creating it's object.
author and iconoclast