package firstPackage;
public class First {
String name;
}
package secondPackage;
import firstPackage.First ;
public class Second extends First {
//Just extends}
package firstPackage;
import secondPackage.Second;
public class Third {
public void accessThroughReference() {
Second second = new Second();
second.name = "l"; //<---the name is not visible actually
}
}
IDEA suggests that name variable is visible. Actually it is not and compiler shows that.
Description
package firstPackage;
public class First {
String name;
}
package secondPackage;
import firstPackage.First ;
public class Second extends First {
//Just extends}
package firstPackage;
import secondPackage.Second;
public class Third {
public void accessThroughReference() {
Second second = new Second();
second.name = "l"; //<---the name is not visible actually
}
}
IDEA suggests that name variable is visible. Actually it is not and compiler shows that.