how to clone an array???
May 5, 2010 at 3:30 PM
Hi Friend,
Try the following code:
public class CloneArray {
public static void main(String args[]) {
int [] array = { 1,2, 3, 4, 5};
int [] cloneArray = (int[])array.clone();
for(int i=0;i<cloneArray.length;i++){
System.out.println(cloneArray[i]);
}
}
}
Thanks
Related Tutorials/Questions & Answers:
About Object cloning. - Java Interview QuestionsAbout Object
cloning. what is Object
cloning? can u explain... is said to be object cloning.In
java, it has to be done using clone() method.
For more information, visit the following link:
http://www.roseindia.net/
java Advertisements
java cloning - Java Interview Questionsjava cloning how to clone an array??? Hi Friend,
Try the following code:
public class CloneArray {
public static void main(String args[]) {
int [] array = { 1,2, 3, 4, 5};
int [] cloneArray = (int
Cloning a XML Element Cloning a XML Element
...; element in the DOM tree. In general, the
cloning means to create a duplicate. ... is the
Java File: DOMCloneElements.javaADS_TO_REPLACE_2
PHP Clone ObjectPHP Clone Objects:
Meaning of clone is that make multiple identical copies of the original one, the process of
cloning in PHP 5 is quite different from PHP 4... method is used to control the
cloning process.
A clone object is created
java();) {
((Int) e.next()).increase();
}
System.out.println("List after
cloning Core Java Interview Question, Interview Question someone mentions a shallow copy in
Java?
Answer: Object
cloning. ADS...
Core
Java Interview Question Page 2
... the main difference between a Vector and an ArrayList
Answer:
Java Vector class
Java DOM Tutorial
Java DOM Tutorial
... (
Java APIs for
XML Processing) provides a common interface for creating... XML fragments are displayed on the console.
Cloning a XML Element
javajava diff bt core
java and
java JAVAJAVA how the name came for
java language as "
JAVA java java why iterator in
java if we for loop
javajava explain technologies are used in
java now days and structure
java javajava different between
java & core
java Java Java Whether
Java is pure object oriented Language
javajava is
java open source
javajava what is
java reflection
java java in
java does not pointers concept but what is nullpointers in
java?
nullpointer is a runtime Exception
javawhat is the size of array in
java ? what is the size of array in
java ?
what is the mean of finalize in
java javajava give a simple example for inheritance in
java javajava give a simple example for inheritance in
java javajava why to set classpath in
java javajava why to set classpath in
java javajava why to set classpath in
java javajava why to set classpath in
java java java What is ?static? keyword
javajava RARP implementation using
java socket
javajava sample code for RARP using
java javajava Does
java allows multiline comments
JavaJava how to do
java in command prompt
javajava Write a
java code to print "ABABBABCABABBA
javajava write a program in
java to acess the email
javajava send me
java interview questions
javajava how use
java method
javajava what are
JAVA applications development tools
JavaJava Whether
Java is Programming Language or it is SOftware
javajava is
java purely object oriented language
javajava why multiple inheritance is not possible in
java javajava explain object oriented concept in
java java java difference between class and interface
JavaJava how to draw class diagrams in
java javajava write a
java program using filenotfoundexception
javajava pattern code for a given words
java pattern code for a given words pattern
javajava create
java program for delete and update the details,without using database, just a normal
java program
javajava code to search the nodes how to write the
java code to search the nodes using routers
javajava different between
java & core
java
print("code sample
javajava how to invoke one chart
java file from another
java file
javajava hi im new to
java plz suggest me how to master
java....saifjunaid@gmail.com
java java How to set
java Policy for applet using jdk 6