UNB/ CS/ David Bremner/ teaching/ java/ Exotic.java
public class Exotic implements Comparable { 

  private int num; // atomic number 
  private String symbol; // exotic element symbol 
  private double mass; // atomic mass 
  private String name; // name of an exotic element 


  public Exotic (int j, String s, double m, String n) { 
    num = j; 
    symbol = s; 
    mass = m; 
    name = n; 
  } 


  public int compareTo(Object obj){
    
    Exotic other=(Exotic)obj;

    if (this.mass  == other.mass) 
      return 0;
    else if (this.mass < other.mass)
      return (-1);
    else 
      return 1;
        
  }
} // exotic