Results 1 to 3 of 3
  1. #1
    pink123 is offline Member
    Join Date
    Feb 2011
    Posts
    84
    Rep Power
    0

    Default vector.size = -1

    Hi ,

    I have a vector

    Vector test= new vector;
    test .add(some object);
    some object is null here

    When I do test.size what will be the value


    will I be able to do something like this test.elementAt(0)


    Thanks,

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    What happened when you tried?

  3. #3
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,234
    Rep Power
    7

    Default

    When I do test.size what will be the value
    Try it and let us know what the result is.

    will I be able to do something like this test.elementAt(0)
    Try it and let us know what the result is.

    Post your Short, Self Contained, Correct Example if you have a problem.

    We are not here to play a "what if" game. Try it. If it doesn't work the way you expect then post your code and maybe we can suggest something different.

Similar Threads

  1. Help Vector
    By nikosv in forum New To Java
    Replies: 4
    Last Post: 12-16-2010, 05:27 AM
  2. Vector<vector> loop thru
    By ocean in forum New To Java
    Replies: 11
    Last Post: 11-21-2009, 02:17 PM
  3. Setting frame size to the size of an image
    By Yoruichi in forum AWT / Swing
    Replies: 5
    Last Post: 04-22-2009, 04:37 PM
  4. Replies: 1
    Last Post: 04-06-2009, 06:45 AM
  5. vector - get
    By natdizzle in forum New To Java
    Replies: 2
    Last Post: 01-02-2009, 04:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •