• Post Reply Bookmark Topic Watch Topic
  • New Topic

collection class polymorphism  RSS feed

 
siddharth das
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have a doubt.
why

gives compilation error.Animal is a user defined class.
and

gives comilation error?
please suggest me.Thank You.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to JiG(B).
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should not give a compilation error, unless for example class Animal can't be found. If that's the case, then make sure it is on the classpath.

What exactly is the compilation error you get?
 
camilo lopes
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
none of them compels with error, however the code below compels with error sees:


the polimorfismo does not function with generics types as it functions with arrays.
 
Red Smith
Ranch Hand
Posts: 136
1
Netscape Opera Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you are using the Java 5 or Java 6.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!