title: Does a child object lose its unique properties after casting back and forth between a parent class
body: <p>Consider the following classes:</p>
  
  <pre><code>public class Phone {
      private boolean has3g;
  
      public boolean has3g() {
          return has3g;
      }
  
      public void setHas3g(boolean newVal) {
          has3g = newVal;
      }
  }
  
  public class Blackberry extends Phone {
      private boolean hasKeyboard;
  
      public boolean hasKeyboard() {
          return hasKeyboard;
      }
  
      public void setHasKeyboard(boolean newVal) {
          hasKeyboard = newVal;
      }
  }
  </code></pre>
  
  <p>If I was to create an instance of <code>Blackberry</code>, cast it to a <code>Phone</code> object and then cast it back to <code>Blackberry</code>, would the original <code>Blackberry</code> object lose its member variables? E.g:</p>
  
  <pre><code>Blackbery blackbery = new Blackberry();
  blackbery.setHasKeyboard(true);
  
  Phone phone = (Phone)blackbery;
  
  Blackberry blackberry2 = (Blackberry)phone;
  
  // would blackberry2 still contain its original hasKeyboard value?
  boolean hasKeyBoard = blackberry2.hasKeyboard();
  </code></pre>