redho home | products | services
Web Design Forums

Web Design Forums  


Web Hosting, Web Design, Software and Web Development Forums  
 FAQFAQ   MemberlistArchive  Log inLog in   RegisterRegister 
         

adding generics


Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum
View previous topic :: View next topic  
Author Message
Aaron Zapashniy



Joined: 04 Jun 2006
Posts: 17
Location: Hungary
To me, List list = new ArrayList(); is a GENERIC list, and List<Wookie> = new ArrayList<Wookie>(); is ..well i wouldn't call it a Template either but it's not generic.
  Reply with quote


amoralis



Joined: 22 Jun 2006
Posts: 21
If you passed in a List of Parent that was populated by all child classes that would not introduce any problems, but as soon as you try to passing a generified list parameterized to child into a method requiring a list parameterized as parent it has issues... that's stupid. It would not cause any problems.
  Reply with quote
Gladis



Joined: 24 May 2006
Posts: 108
Aaron Zapashniy, std::vector<wookie>; <- I would call that templates.
  Reply with quote
Aaron Zapashniy



Joined: 04 Jun 2006
Posts: 17
Location: Hungary
I would ask how you got an STD from a wookie Smile
  Reply with quote
amoralis



Joined: 22 Jun 2006
Posts: 21
Gladis, I think the reason for the name difference is that in C++ it effects code outcome, in java it doesn't
  Reply with quote
Gladis



Joined: 24 May 2006
Posts: 108
Std is the standard namespace... C++ has templates.
  Reply with quote
amoralis



Joined: 22 Jun 2006
Posts: 21
In java it only represents compile time checking
  Reply with quote
Gladis



Joined: 24 May 2006
Posts: 108
amoralis, It SHOULD affect code. Compile time checking leads to a few problems.
For instance... can't create genericized lists.
  Reply with quote
AmeliaR



Joined: 31 May 2006
Posts: 142
The difference is that c++ template generate code. java's generics do not.
  Reply with quote
amoralis



Joined: 22 Jun 2006
Posts: 21
That's what I just said :)
  Reply with quote
Page 3 of 5 Goto page Previous  1, 2, 3, 4, 5  Next
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group