Java Vector clone() MethodLast Updated : 17 Mar 2025 The clone() method of Java Vector class is used to get a clone of the vector which is in use. Syntax:Following is the declaration of clone() method: Parameter:This method does not accept any parameter. Returns:This method returns a clone of the vector which is in use. Exceptions:NA Compatibility Version:Java 1.2 and above Example 1:Output: Original vector: [Tiger, Deer, Dog, Camel] Cloned vector: [Tiger, Deer, Dog, Camel] Example 2:Output: Elements in vector are: Number = 4 Number = 3 Number = 2 Number = 1 Elements in vecclone vector are: Number = 4 Number = 3 Number = 2 Number = 1 Next TopicJava Vector |
We request you to subscribe our newsletter for upcoming updates.

We deliver comprehensive tutorials, interview question-answers, MCQs, study materials on leading programming languages and web technologies like Data Science, MEAN/MERN full stack development, Python, Java, C++, C, HTML, React, Angular, PHP and much more to support your learning and career growth.
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India