• 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

Doubts

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

I've the following 3 doubts.

1. I find that it is possible to throw AssertionError. In some book, I studied that one cannot throw an AssertionError. which one is correct?

2. I hardly could understand finding the appropriate hashcode method. Could anyone point me a good resource for understanding the hashcode implementation.

3. I read Generic Declarations in Kathy Sierra. I cud understand Generics clearly but not the Generics Declarations i.e <T> and <E> Please help me out to resolve this.

Naveen.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch
  • 1: Of course you can throw an AssertionError. It is probably, however, not a good idea to throw any kind of Error.
  • 2: Thinking in Java by Bruce Eckel, and Effective Java by Joshua Bloch. There is a sample chapter somewhere on the Sun site from Bloch which probably covers hashCode(), and Eckel 3rd edition is available free on the Internet.
  • 3: Read the generics part of the Java Tutorials, where you find that <E> for element and <T> for type are shorthand for the kinds of objects you are allowing into a generic type.
  •  
    Campbell Ritchie
    Marshal
    Posts: 79177
    377
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    . . . and please use a more informative title for your posts.
     
    If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic