aspose file tools
The moose likes Beginning Java and the fly likes collection class polymorphism Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "collection class polymorphism" Watch "collection class polymorphism" New topic
Author

collection class polymorphism

siddharth das
Ranch Hand

Joined: Aug 17, 2007
Posts: 124
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
Marshal

Joined: Jul 20, 2005
Posts: 8147
    
  52

Moving to JiG(B).


[My Blog] [JavaRanch Journal]
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12929
    
    3

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?


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
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.


Brazil - Sun Certified Java Programmer - SCJP 5
http://www.camilolopes.com/ About Java - Update every Week.
Guide SCJP - tips that you need know http://blog.camilolopes.com.br/livrosrevistaspalestras/
Red Smith
Ranch Hand

Joined: Aug 05, 2007
Posts: 105
Make sure you are using the Java 5 or Java 6.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: collection class polymorphism
 
Similar Threads
Sierra/Bates, Chapter 7, Two Minute Section
<? super Integer>
Generics doubt
Generics doubt