Sapient
Company
Programming
What should be the access specifiers for function Bob() in the following code snippet so that the program doesn't get compiler error?
class Base{
---1--- void Bob(){}
}
class Derived extends Base{
---2--- void Bob(){}
}
public class Main{
public static void main(String args[]){
Derived d = new Derived();
}
}
1) 1=public 2=protected
2) 1=public 2=private
3) 1=private 2=public
4) 1=private 2=protected
Read Solution (Total 1)
-
- 3) 1=private 2=public
4) 1=private 2=protected - 7 years agoHelpfull: Yes(0) No(1)
Sapient Other Question