Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


dibya ranjan subudhi
java cloning
2 Answer(s)      4 years and 6 months ago
Posted in : Java Interview Questions


how to clone an array???

Advertisement
View Answers

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


December 12, 2011 at 5:26 PM


Interview questions



Related Tutorials/Questions & Answers:
cloning - Java Beginners
cloning  Dear Sir, Can you send a simple java program for CLONING an object
About Object cloning. - Java Interview Questions
About 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 Questions
java 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. ...; </Employee> </Employee-Detail> Here is the Java File
PHP Clone Object
PHP 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
Marvellous chance to learn java from the Java Experts
Marvellous chance to learn java from the Java Experts A foundation course on Java technology which: Makes you an expert on Core Java technology
Core Java Interview Question, Interview Question
mentions a shallow copy in Java? Answer: Object cloning. Question: If you're... Core Java Interview Question Page 2   ... a Vector and an ArrayList Answer: Java Vector class is internally synchronized
java
java  diff bt core java and java
java
java  what is java
java
java  different between java & core java
java
java  explain technologies are used in java now days and structure java
java
java   why iterator in java if we for loop
Java
Java   Whether Java is pure object oriented Language
JAVA
JAVA  how the name came for java language as "JAVA
java
java  what is java reflection
java
java  is java open source
java
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
java
java  write a java program using filenotfoundexception
java
java   difference between class and interface
java
java  why multiple inheritance is not possible in java
java
java  is java purely object oriented language
java
java  how use java method
java
java  send me java interview questions
java
java  write a program in java to acess the email
java
java  Write a java code to print "ABABBABCABABBA
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  give a simple example for inheritance in java
Advertisements
 

 

 

DMCA.com