Java Vector size() MethodThe size() method of Java Vector class is used to get the number of components presents in the vector. SyntaxFollowing is the declaration of size() method: ParameterThis method does not accept any parameter. ReturnThe size() method returns the number of components presents in a vector. ExceptionsNA Compatibility VersionJava 1.2 and above Example 1Test it NowOutput: The vector Element is = [10, 20, 30, 40, 50] Size of the vector is = 5 Example 2Test it NowOutput: Size of the vector is = 4 Next TopicJava Vector Sort Method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India