Q: You are to complete the code needed to create methods in a class with inheritance. You would like your method accessible to any class in the system. Which will best complete this statement?
____ void getFromDialog()
{
~~~Body of code ~~~
super();
}
The public keyword is used to make the given method accessible from any other class in the system.
The private keyword only allows access from within the scope of the given method. This prevents accidental or unintentional re-use.
The protected keyword allows access to any subclasses that may extend the class that the method resides in. However, it prevents access from all other outside object calls.
The void keyword is already explicitly stated in the code snippet, and should not be used twice. This indicates that the given method does not return a value. The void keyword is used in conjunction with the scoping keywords: private, public and protected.