General X++ Development
How do I create and use an abstract class in X++?
How do I create and use an abstract class in X++?
1 answer
Write an answerCreate an abstract base class when implementations should share behavior or state but still provide their own implementation for part of the process.
abstract class MyProcessorBase
{
public abstract void process();
public void logStart()
{
info('Starting.');
}
}A derived class then implements process().
Use an interface when you only need a contract. Use an abstract class when there is actual base behavior worth sharing.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer