________________________________________ | | |Fraction implements Comparable| <----Class Name |________________________________________| | - int denominator | | - int numerator | <---members or attributes |________________________________________| | | | + Fraction() | | + Fraction(int) | | + Fraction(int,int) | | | | + getNumerator() :int | | + getDenominator() :int | | + equals(Fraction) :boolean | | | | + add(Fraction) :Fraction | | + difference(Fraction) :Fraction | | + product(Fraction) : Fraction | | + divide(Fraction) :Fraction | <--methods | + reciprocal() :Fraction | | + increment() :void | | + compareTo(Fraction) :int | | + toString() : toString | | - reduce() :void | | - gcd(int,int) :int | |________________________________________| Class Diagram of Fraction Using UML (Universal Modeling Language) The '+' means it is public, the '-' means private. public means it can be used outside the class. private means that it can be used ONLY inside the class itself. The first box is the name of the class, the second box is the members or attributes, and the third box is the methods (including the constructor.) The interface consists of just the public members and methods.