• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enumeration & Properties

 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi *.*,
I wanna know whether java.util.Enumeration is a class or interface? And is it deprectaed in favor of Collection Framework? Why servlets don't use ArrayList or Arrays in lieu of Enumeration in some cases?
And lemme know a little bit about Properties also....

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
Allan Moster
Ranch Hand
Posts: 153
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both are interfaces. I don't think Enumeration is deprecated. Iterator interface duplicates the functionality of Enumeration and added a method to remove elements from the underlying collection. SUN suggests that new implementations should consider using Iterator instead of Enumeration.
Properties class provides for key-value pair since it extends Hashtable.
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thnx Alan, i was fond of some sort of brief description like this!

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a long time, the Servlet API was kept compatible with JDK v1.1. So that meant using Enumerations and the like rather than the Collections framework.
I bet Sun would like to deprecate the old-style collections (Enumeration, Vector, Hashtable, etc) if they could. But they are too firmly entrenched in a number of often-used APIs.
- Peter
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter, i completely agree with you and was also thinking in this track. Despite the fact, may be a few years later these will change ....at least hope so...

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic