nerdexam
Microsoft

MB6-704 · Question #15

You are developing a class named Classl that performs several calculations. One of the methods in Classl is named method 1. Other developers will create classes that inherit from Classl. You need to…

The correct answer is D. Private. Methods that are declared as private can be called only from methods in the class where the pri- vate method is declared.

inventory configuration

Question

You are developing a class named Classl that performs several calculations. One of the methods in Classl is named method 1. Other developers will create classes that inherit from Classl. You need to ensure that methodl is available to Classl and to all of the classes that inherit Classl. The developers must not be able to call methodl from any other classes. Which keyword should you use to define methodl?

Options

  • AProtected
  • BPublic
  • CServer
  • DPrivate

How the community answered

(53 responses)
  • A
    6% (3)
  • B
    2% (1)
  • C
    11% (6)
  • D
    81% (43)

Explanation

Methods that are declared as private can be called only from methods in the class where the pri- vate method is declared.

Topics

#X++ classes#method access modifiers#inheritance#encapsulation

Community Discussion

No community discussion yet for this question.

Full MB6-704 Practice