M
man4*.*
code example:
package somethingElse;
public class B {
protected void methodInB() { /*something*/}
}
package certification;
import somethingElse.B;
public class A extends B {
public A {
B newObject = new B();
newObject.methodInB(); //won't compile
methodInB(); //this works
}
}
why I can't acces methodInB over reference?
package somethingElse;
public class B {
protected void methodInB() { /*something*/}
}
package certification;
import somethingElse.B;
public class A extends B {
public A {
B newObject = new B();
newObject.methodInB(); //won't compile
methodInB(); //this works
}
}
why I can't acces methodInB over reference?