• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fields in Java Api

 
Anurag Mishra
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anurag Mishra
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic