• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Enumeration of Strings

 
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
 
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.
 
What are you doing? You are supposed to be reading this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic