• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generic Declarations page 597

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

So far i have reached till chapter 7;i understood all till page 596 but i am confused and bored to read Generic Declarations though i tried to read but i was not getting what it is all about

Can any one please explain me in why that whole section is about ...E and T...totally confused

please help
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

totally confused



Me too. What book ? Which edition ? What is available on page 597 ?

You want help with Collections and generics ?
 
Sneha Kapoor
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i am talking about generics from K&B book ...for scjp 1.5
 
Ranch Hand
Posts: 282
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Collections framework makes heavy use of generics. For example, you can use the List class to create a list of any sort of object:

The compiler then can enforce that only objects of the specified class can be added/retrieved:

Before generics, you had to do a lot of casting and ran the risk of getting a ClassCastException (meaning you were notified of the error at runtime, as opposed to compile time--a bad thing):
 
reply
    Bookmark Topic Watch Topic
  • New Topic