• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enumeration of Strings

 
Ken Januski
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm starting the SCWCD Study Kit book and keep running into passages like:
>>Enumeration getHeaders(String headerName) This method returns all the values associated with the header as an Enumeration of String objects.
I'm just curious about this and am wondering if it's just idiomatic Java. The method really returns an Enumeration doesn't it? And that holds Objects that need to be cast to Strings?
I'm not asking to be picky. I'm just not all that familiar with Enumerations and want to make sure I really understand what is going on. In other words does it really return and Enumeration of String objects? The API just says it returns an Enumeration.
Thanks for any clarification,
Ken
 
Kem Bro
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ken,
Yes, an Enumeration is a collection of objects. Each object must be cast when you're reading it from the Enumeration.
Cheers
.
 
Kem Bro
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...I guess they say an Enumeration of Strings just to let you know what the object types are.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic