I have a school assignment where I have to write class files to correspond with my instructor's already written class, which includes the main() method.
He has the main class importing the child class of a ParentClass, each of which is in a different package. In the main method, he goes on to create an instance of the ParentClass, but when I try to compile I get errors: "ParentClass cannot be resolved to a type." This makes sense to me since the ParentClass is never imported. I just don't really know what I would have to do to make this instantiation legal, or whether it's even possible to do or not(since I can't import the ParentClass). I would only be able to fix it in my ParentClass or child class.
Here is part of the main method, which I am unable to alter:
package edu.louisville.cecs.hw2;
import hw2.pkg2.ChildClassInAnotherPackage;
public class Example {
public static void main( String [] args ) {
ParentClass parent = new ParentClass( "privateProperty", "publicProperty", "protectedProperty", "packageProperty" );
}
}
Any help you guys could give me on this would be greatly appreciated.