SyntaxFix
Write A Post
Hire A Developer
Questions
You declare parent as Parent, so java will provide only methods and attributes of the Parent class.
Child child = new Child();
should work. Or
Parent child = new Child(); ((Child)child).salary = 1;