Which modifier should used in place of **** , so that it's subclass saved in other package can access " FixVariable() " method of it's super class ?
package NewPackage;
public class Example extends rose{
private int length;
*** void FixVariable( int a ) {
length = a;
}
}
// subclass in different package
import NewPackage.Example ;
public class SubExample extends Example {
SubExample() {
FixVariable( 201 );
}
Which modifier should used in place of ****, so that it's subclass 'SubExample' saved in other package can access 'FixVariable()' method of it's super class ?
1.private
2.public
3.protected
4.default(blank)
2 & 3
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.