GeeCON Prague 2014*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Enumeration & Properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Enumeration & Properties" Watch "Enumeration & Properties" New topic
Author

Enumeration & Properties

Ashik Uzzaman
Ranch Hand

Joined: Jul 05, 2001
Posts: 2370

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!


Ashik Uzzaman
Senior Member of Technical Staff, Salesforce.com, San Francisco, CA, USA.
Allan Moster
Ranch Hand

Joined: Sep 14, 2001
Posts: 153
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

Joined: Jul 05, 2001
Posts: 2370

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

Joined: Apr 20, 2000
Posts: 3252
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

Joined: Jul 05, 2001
Posts: 2370

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!
 
GeeCON Prague 2014
 
subject: Enumeration & Properties