I have an abstract class called Building, and two sub classes called Flat and House, and a class called BuildingSystem. Constructors, instance variables are all there. In this class, Building System I have an array called Building [] build and each subclass has its own getValue() method.
In building System i have a method to add building to array

public void addBuilding (Building leftover)
if (extra == null || numberofBuilids > maximum)
build[numberOfBuilds] = extra;

then I create a new Building instance
public Building createBuilding()
String name;
double type;
double insu;
Building build;

for (int i = 0; i < maximum; i ++)
name = Keyboard.readString "Name: ")
insu = Keyboard.readDouble("Insurance ")
type = Keyboard.readBuilding ("type")
if (type == 1)
build = new House(name, type)
if (type == 2)
buid = new Flat (name, type)
} return build;

Now in a method that has to be called
public Building findHighestValue(int buildtype)
I want it to search through the property array, and return the highest getValue method for each type of building eg
If the buildtype was 1, i want to get the highest getValue() from the Flats and if it were 2 I want it to do the same except get highest of the House instances an for 0 i want t tot return highest of all. Any tips ? Thanks heaps .