Computer Science, asked by sarkarsid, 8 months ago

Assume class Calculator in package p1 and CalculatorService class in package p2 as shown below.
package p1;
public class Calculator {
static void calculate(){
// some code here
}
package p2;
import p1.Calculator,
public class CalculatorService {
public void display({
Calculator.calculate();
}
}
What can be the valid access specifier for the calculate method in Calculator class so that it can be
accessed from Calculator Service class?
Select one:
a. public
b. private
c. default
d. Any access specifier except private
e protected​

Answers

Answered by tallaalekhya99
15

Answer:

public is the answer to access the outside package

Similar questions