This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Fields in Java Api Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Fields in Java Api" Watch "Fields in Java Api" New topic
Author

Fields in Java Api

Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
Hi,
its a basic Question,
If we see the Java Api docs provided by sun
for java.util.Vector
In this there they have defined a protected field called
as "elementCount"
Can anyone just tell how i can use this.
say in a simple programm pls provide sample if possible.
thanks
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

The only time you would use this field is if you were writing a class that extended Vector and changed its behavior somehow, and in doing so, you needed to know that number of elements held by the Vector. Extending Vector isn't something you're likely to want or need to do.


[Jess in Action][AskingGoodQuestions]
Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
thanks a lot,
Actually even i hadimported the java.util.vector class i was not able to use this field, later i came to know since its a protected field so we
must need to extend vector class to access this.
thanks a lot for ur reply.
 
wood burning stoves
 
subject: Fields in Java Api
 
Similar Threads
JavaFX has an API of it own?
java api download
java
Simple questions from a novice
Time Triggered events in Javascript