A developer created a Lightning component to display a short text summary for an object and wants to use it with multiple Apex classes. How should the developer design the Apex classes?
A.
Have each class define method getObject() that returns the sObject that is controlled by the Apex class.
B.
Extend each class from the same base class that has a method getTextSummary() that returns the summary.
C.
Have each class implement an interface that defines method getTextSummary() that returns the summary.
D.
Have each class define method getTextSummary() that returns the summary.
B is the right answer.
If you extend a class from the parent class, you can use parent methods in child methods. Otherwise, if you implement the class, it will be necessary to implement as well all its methods, so the desired code will need to be replicated many times.
Answer C is Correct Because if you extend it from a base class so after that it cannot extend other class if needed so creating an Interface is more suitable here.
Extend each class from the same base class that has a method getTextSummary() that returns the summary. is the correct answer
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Infoash
Highly Voted 4 years, 1 month agoPrivateUser
Most Recent 1 month agoBrinuz
1 year, 3 months agogovosen887
1 year, 7 months agoChie_cayanan
1 year, 7 months agoRajiv1406
2 years, 2 months agoMikeSignok
2 years, 10 months agoesteban17
3 years, 2 months ago