Apstraktna klasa

U objektno orijentiranom programiranju apstraktna klasahttps://www.fer.unizg.hr/_download/repository/05-Apstraktne_klase_i%20_sucelja.pdf je računarska klasa koja ne može imati objekte. Njena osnovna svrha je da bude roditelj drugim, konkretnim klasama. Iz tog razloga ne može imati sve metode implementirane i treba imati barem jednu apstraktnu metodu, tj. čisto virtualnu metodu u C++u.
 Primjer (Java) 

abstract class Demo {
    // An abstract class may include abstract methods, which have no implementation.
    abstract public int sum(int x, int y);

    // An abstract class may also include concrete methods.
    public int product(int x, int y) { return x*y; }
}

interface DemoInterface {
    // All methods in an interface are abstract.
    int getLength();
}

 Reference 

 Vanjski linkovi 
 http://download.oracle.com/javase/tutorial/java/IandI/abstract.html
 Riel, Arthur (1996). Object-Oriented Design Heuristics. Addison-Wesley Professional. p. 89. .
 Meyers, Scott (1996). More Effective C++. Addison-Wesley Professional. str. 258. .
 [www.headfirstlabs.com/books/hfjava/ Head First Java]. O'Reilly Media. 2003. str. 688. . www.headfirstlabs.com/books/hfjava/.
 Types and Programming Languages by Benjamin Pierce (MIT Press 2002) [1]
 More Effective C++: 35 New Ways to Improve Your Programs and Designs by Scott Meyers (1995) 
 Traits: Composable Units of Behavior by Nathanael Schärli, Stéphane Ducasse, Oscar Nierstrasz and Andrew Black

Kategorija:Programiranje