我需要帮助来理解为什么即使在类级别创建对象后也无法访问main方法内的父类成员
父班
package SuperConcepts;
public class SuperConceptsExample {
public String color = "red";
}
儿童班
package SuperConcepts;
public class SuperConceptsExample1 extends SuperConceptsExample {
String color1 = "orange";
SuperConceptsExample s1 = new SuperConceptsExample();
public void display() {
System.out.println(super.color);
}
public static void main(String[] args) {
System.out.println(s1.display); // Unable to access it though i have created the object
}
}