Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDaniel Hildreth
16,170 PointsWhy exactly do we use the abstract keyword?
Is the abstract keyword literally to implement a class that we want as a basic blueprint for another class? Or is there also another purpose to have abstract classes?
2 Answers
Hendrik Heim
1,012 PointsThe abstract modifier indicates that the thing being modified has a missing or incomplete implementation. The abstract modifier can be used with classes, methods, properties, indexers, and events. Use the abstract modifier in a class declaration to indicate that a class is intended only to be a base class of other classes. Members marked as abstract, or included in an abstract class, must be implemented by classes that derive from the abstract class.
Source: MSDN
Andrei Li
34,475 PointsVery helpful! Abstract just keeps us organized.
Daniel Hildreth
16,170 PointsDaniel Hildreth
16,170 PointsThat makes sense. Thanks.
Ole Vølund Skov Mortensen
27,842 PointsOle Vølund Skov Mortensen
27,842 Points"Members marked as abstract, or included in an abstract class, must be implemented by classes..."
.... Wait, so how does abstract classes differ from Interfaces? I'm a little confused.