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

Coderanch | archu sweet | 6 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  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