public
synchronized String toString()
Returns a
string representation of this Vector.
import java.util.*; class VectorToString{ public static void main(String args[]){ Vector<Integer> myVector = new Vector<> (); /* Add Elements to myVector */ myVector.add(10); myVector.add(123); myVector.add(321); myVector.add(456); System.out.println(myVector.toString()); } }
Output
[10, 123, 321, 456]
No comments:
Post a Comment