Lecture overview -- Keyboard shortcut: 'u'  Previous page: Subcontracting -- Keyboard shortcut: 'p'  Next page: Assertions in Abstract classes -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 25 : 32
Object-oriented Programming in C#
Contracts and Assertions
Class invariants in the triangle class hierarchy

Most general triangle:
3 non-zero angles
3 non-zero edges
Sum of angles: 180 degrees

Isosceles triangle
Invariant of general triangle
2 edges of equal length

Equilateral triangle:
Invariant of isosceles triangle
3 edges of equal length

Right triangle:
Invariant of general triangle
Pythagoras

Isosceles right triangle:
Invariant of isosceles triangle
Invariant of right triangle