• Post Reply Bookmark Topic Watch Topic
  • New Topic

failing to understand abstract with passing type - ClassName<T>  RSS feed

 
nicolas diogo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i am sorry for asking this topic again - but do not know how to call it and when searching for "<T>" it only turns up pages with any T in it.

i have done some java coding - but would not qualify myself as knowing it all.

but something that i am find more and more useful is the usage of abstract classes.

but i am failing to fully understand the process that i can pass a TYPE into the abstract to use.

i figure that my class has to have the type on it 'name' as:



but i am failing to use the type <T> within the class.
could someone please provide me with a link or clarification on this?

thanks,
 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are correct that abstract classes are very useful. i don't understand your code though. did you mean (T) instead of <T>? and what is T anyway?
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The term you are looking for is generics.
 
Randall Twede
Ranch Hand
Posts: 4696
8
Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ah generics, i must read. i still think in java2
 
nicolas diogo
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks Joanne

i was getting lost in trying to figure out this name

Cheers!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!