Re: Vector Storing



andrewzzz wrote:
In a class I have to store and mantain a Vector object.
I can declare it as static, but anyway to access it I have to
initialize the Vector (new Vector()) ... so everytime I create a new
instance of this class I lose my data(??).


actual :

private static Vector dynvector;


in the constructor :

dynvector=new Vector;
dynvector.add(de);//add de to the end of the vector


What should I do to save the content of a vector ???

What are you trying to do with the Vector? The above example makes no sense to me.

--
-Aki Laukkanen
.



Relevant Pages

  • Re: Vector Storing
    ... I can declare it as static, but anyway to access it I have to ... initialize the Vector ) ... ... so everytime I create a new ... of which is the parameter passed to the constructor. ...
    (comp.lang.java.programmer)
  • Re: Vector Storing
    ... I can declare it as static, but anyway to access it I have to ... initialize the Vector ) ... ... so everytime I create a new ... EveryTime the construcor of that class is called I have to append in ...
    (comp.lang.java.programmer)
  • Re: "no variable or argument declarations are necessary."
    ... the compilor will allert you ... If I forget to declare several variables in C, ... >> forget to initialize several variables in Python, ... > runtime error per "forgot to initialize". ...
    (comp.lang.python)
  • Re: Replicating results
    ... gradient calculation used in a large optimization routine. ... It will make sure that if you do something like declare a variable called "x1" and use a variable called "xl" the compiler will tell you that xl was undeclared. ... Make sure that you initialize all of your variables, ...
    (comp.lang.fortran)
  • Re: question on scope of a variable
    ... G'day "Chip Orange", ... If I have a std code module and declare at the top of it, ... >to be able to initialize it, or have access to it's value if it's ... >While this compiles for me, I'm getting a runtime error that indicates the ...
    (microsoft.public.word.vba.general)