FileDocCategorySizeDatePackage
Mountains.javaAPI DocExample721Wed Mar 06 14:46:52 GMT 2002myprojects.linktest

Mountains

public class Mountains extends Object implements Comparable

Fields Summary
private String
name
private int
height
Constructors Summary
public Mountains(String name, int height)

		setDetails(name,height);
	
Methods Summary
public intcompareTo(java.lang.Object o)

		Mountains m = (Mountains) o;
		if(m.height < height) {
			return -1;
		} else if (m.height == height) {
			return 0;
		}
		return 1;
	
public voiddisplayDetails()

		System.out.println("Mountain "+name+ " is "+height+" metres high");
	
public intgetHeight()

		return height;
	
public java.lang.StringgetName()

		return name;
	
public voidsetDetails(java.lang.String name, int height)

		this.name = name;
		this.height = height;