title: Can't extend a class in Java
body: <p>i feel stupid ask this question, but i really dont see the problem. Compiling it gave me ClassCastExeption</p>
  
  <p>This is the super class</p>
  
  <pre><code>package elements;
  import persistence.postgres.DataSource;
  import persistence.postgres.IdBroker;
  import persistence.postgres.PersistenceException;
  import util.Util;
  
  public class Hotspot {
  private double lat;
  private double lng;
  private long id;
  private String username;
  private String time_stamp;
  private String point_of_interest;
  private String comment;
  
  public Hotspot(double lat, double lng, String username, String comment, String p_o_i) {
      this.lat = lat;
      this.lng = lng;
      this.username = username;
      try {
          this.id = IdBroker.getId(new DataSource().getConnection());
      } catch (PersistenceException e) {
          e.printStackTrace();
      }
      time_stamp = Util.timeStamp();
      this.comment = comment;
      this.point_of_interest = p_o_i;
  }
  
  public Hotspot(double lat, double lng, String username, long id,  String time_stamp) {
      this.lat = lat;
      this.lng = lng;
      this.username = username;
      this.id = id;
      this.time_stamp = time_stamp;
  }
  
  //Getter Setter for all variable and HashCode/Equals
  
  }
  </code></pre>
  
  <p>And this is the subcalss</p>
  
  <pre><code>package persistence.postgres;
  
  import elements.Details;
  import elements.Hotspot;
  
  public class HotspotProxy extends Hotspot {
  private HotSpotDAOpostgres hsd;
  private Details details;
  
  //insert
  public HotspotProxy(double lat, double lng, String username, String comment, String poi) {
      super(lat, lng, username, comment, poi);
      this.hsd = new HotSpotDAOpostgres();
  }
  
  //Retrieve
  public HotspotProxy(double lat, double lng, String username, long id, String time_stamp) {
      super(lat, lng, username, id, time_stamp);
      this.hsd = new HotSpotDAOpostgres();
  }
  
  public String getPointOfInterest() {
      redifined method
  }
  
  public String getComment() {
          //redifined method
  }
  }
  </code></pre>
  
  <p>and this give me error</p>
  
  <pre><code>Hotspot h = new Hotspot(31.124, 43.123, "name", "comment", "point of interest");
  HotspotProxy hp = (HotspotProxy)h;
  </code></pre>
  
  <p>Please tell me where im failing. thanks for any suggention</p>