This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I dont think so , private = only visible to the current class You cant access it in anyway You might think of overriding it but you actually creating a new method in the SubClass please correct me if I am wrong
Hi Cristian, No you can't override a private method. Since the subclass doesn't even see the method it can't replace it. If you call methodB from SuperClass methodA it only sees its own private method. Therefore, from SuperClass methodA you can not call SubClass methodB. However, if in the SubClass main you create a SubClass reference variable then you can call its' methodB class. Example: