1) Vector v = null; v = new Vector(); v = mgr.displayUser(); 2) // no initialisation and instantiation Vector v = mgr.displayUser(); 3) // initialisation only Vector v = null; Vector v = mgr.displayUser(); Do i need to initialise or instantiate the class Vector before the method "displayUser() returned it as vector? In fact, all approaches are working. But what i concerned is which one performs better and waste not much resources.
Kaz Yosh
Ranch Hand
Joined: May 22, 2003
Posts: 63
posted
0
Hi, What does this object and method do? v = mgr.displayUser();
"If anything can go wrong, it will"
Michelle Joe
Greenhorn
Joined: Oct 29, 2002
Posts: 11
posted
0
Kaz Yosh, Basically, displayUser() will return the user details in Vector form.