Accessing a protected method.
Hello Java Gurus,
I have a question. I have a class which is having the protected method which is the method that is used to generate the result that I want to obtain(I have no idea why it is made protected as I think it should be public). Anyways !!! No I want to access that method(which is generating the result) into a class(this class is already extending one class) which is in another package without extending the class which contains the method(one generating the result).Is there any way to do this?
Let me explain it to you in this way
com.result(Package)
public Class GiveResult{
protected calculateResult(){...}
}
com.service(Second package)
public Class AccessResult extends SomeOtherClass{
// In this class I want to access calculateResult method from the GiveResult class.
}
I hope I have made myself clear.
Thanks