re. the Enumeration interface.

S

Steve R. Burrus

Is the Enumeration interface archaic/deprecated by now??? If so, just
what are the proper methods that should be used now for whatever
replaced it some time ago???!!! I am trying to use Enumeration in a
particular servlet right now, but get compiler errors when it's
referenced in the servlet.
 
P

Paul Lutus

Steve said:
Is the Enumeration interface archaic/deprecated by now???

Define "by now". It is not deprecated as of Java 1.4.2.
If so, just
what are the proper methods that should be used now for whatever
replaced it some time ago???!!!

That depends. What are you trying to do?
I am trying to use Enumeration in a
particular servlet right now, but get compiler errors when it's
referenced in the servlet.

Oh, so you got the dreaded "compiler error" error? No? Then what specific
compiler error did you actually get, from what source code?
 
M

Michael Borgwardt

Steve said:
Is the Enumeration interface archaic/deprecated by now??? If so, just
what are the proper methods that should be used now for whatever
replaced it some time ago???!!! I am trying to use Enumeration in a
particular servlet right now, but get compiler errors when it's
referenced in the servlet.

Even though it has been replaced by Iterators, Enumeration is not
officially deprecated and its usage as such should produce neither
compiler errors nor warnings.
 
S

Steve Cassidy

Steve R. Burrus said:
Is the Enumeration interface archaic/deprecated by now??? If so, just
particular servlet right now, but get compiler errors when it's referenced
in the servlet.

The compiler may not be be able to find the Enumeration class. Try includng
import java.util.Enumeration; or
import java.util.*; at the top you your class, or in the code try declaring
the enumeration as java.util.Enumeration rather than just Enumeration. The
import statement just lets you reference classes without putting their
package names in front. If you look at the top of your servlet code, you'll
probably see import javax.servlet.http.* - this is what's letting you
reference HttpServletRequest etc in your doGet() declaration rather than
having to type out javax.servlet.http.HttpServletRequest. That's what
"import" is for. HTH.
 
I

iamfractal

Steve R. Burrus said:
Is the Enumeration interface archaic/deprecated by now??? If so, just
what are the proper methods that should be used now for whatever
replaced it some time ago???!!! I am trying to use Enumeration in a
particular servlet right now, but get compiler errors when it's
referenced in the servlet.


I don't know why you're getting compiler errors; this certainly should
not happen due to an interface's deprecation (not that it has been).

Javadoc for Enumeration:
"NOTE: The functionality of this interface is duplicated by the
Iterator interface. In addition, Iterator adds an optional remove
operation, and has shorter method names. New implementations should
consider using Iterator in preference to Enumeration. "


..ed

www.EdmundKirwan.com - Home of The Fractal Class Composition
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top