java.lang.ClassCastException: Hi.Dog1 cannot be cast to Hi.Cat5

Coderanch | archu sweet | 6 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Doubt regarding downcasting and upcasting

    Coderanch | 6 years ago | archu sweet
    java.lang.ClassCastException: Hi.Dog1 cannot be cast to Hi.Cat5

    Root Cause Analysis

    1. java.lang.ClassCastException

      Hi.Dog1 cannot be cast to Hi.Cat5

      at Hi.Cat5.main()
    2. Hi
      Cat5.main
      1. Hi.Cat5.main(Cat5.java:8)
      1 frame