Single Choice
Easy
QYou 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();
}
ID: #9381
Classes in D365 F&O X++
161 views
Question Info
#9381Q ID
EasyDifficulty
Classes in D365 F&O X++Topic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
Justification:
- 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.
Related Lesson: Best Practices
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic