You can calculate the area of a surface with one of these three methods:

In Program: Area calculation for a shapefile, we calculate and output the area of the elements of a shapefile.

Program: Area calculation for a shapefile
ILcdModel model = new TLcdSHPModelDecoder2().decode("Data/Shp/World/world.shp");
ILcdEllipsoid ellipsoid = ((ILcdGeodeticReference) model.getModelReference()).getGeodeticDatum().getEllipsoid();
Enumeration elements = model.elements();
while (elements.hasMoreElements()) {
  Object element = elements.nextElement();
  String countryName = (String) ((ILcdDataObject) element).getValue("COUNTRY");
  double countryAreaSqM = TLcdEllipsoidUtil.geodesicArea((ILcdShape) element, ellipsoid);
  System.out.println(String.format("%s: %.2f km2", countryName, countryAreaSqM / 1e6));
}

See the API reference documentation for more details and limitations.

area calculation example
Figure 1. An example of the area of a complex polygon