Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 35 discussion

Actual exam question from Salesforce's CRT-450
Question #: 35
Topic #: 1
[All CRT-450 Questions]

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.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Infoash
Highly Voted 4 years, 1 month ago
The answer is B. Extend each class from the same base class that has a method getTextSummary() that returns the summary.
upvoted 15 times
...
PrivateUser
Most Recent 1 month ago
Selected Answer: B
Answer is B
upvoted 1 times
...
Brinuz
1 year, 3 months ago
Selected Answer: B
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.
upvoted 2 times
...
govosen887
1 year, 7 months ago
Selected Answer: C
Interface is the most suitable when we want specific behavior on many otherwise unrelated classes - C
upvoted 2 times
...
Chie_cayanan
1 year, 7 months ago
Selected Answer: C
C actually works, I used that method in several times.
upvoted 2 times
...
Rajiv1406
2 years, 2 months ago
Selected Answer: C
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.
upvoted 3 times
...
MikeSignok
2 years, 10 months ago
If extends, those classes will get the same text summary returned. If implemented, each class can define it text summary. The question is ambiguous
upvoted 4 times
...
esteban17
3 years, 2 months ago
Extend each class from the same base class that has a method getTextSummary() that returns the summary. is the correct answer
upvoted 4 times
...
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.

SaveCancel
Loading ...