OO Programming with Java


Go further

1. Starting with Eclipse platform

Steps

  1. Create a project, a package and a class with a main method that simply do greeting (using System.out).
  2. Create/use a new class Rectangle having 4 attributes/coordinates and a construtor to initialize them. Also overload the toString operation.
  3. Define a more generic class Shape, use inheritance/extends relation to illustrate polymorphism.
  4. Define Union of two shapes that uses polymorphism.
  5. Define abstract operation then class that ask a shape if it contains a point (x,y).

Notice. Autocompletion and contextual help bring by Eclipse


1