Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to print out # of bytes used

 
E Fox
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a method I can use to determine how much space a vector is taking up? For a program I have to write I need to print out how many bites my vector uses after inserting keys into it.
Thanks
E Fox
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34372
345
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the objects in your Vector implement java.io.Serializable:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic