Clone Array : Array « Collections Data Structure « Java

Java
1. 2D Graphics GUI
2. 3D
3. Advanced Graphics
4. Ant
5. Apache Common
6. Chart
7. Class
8. Collections Data Structure
9. Data Type
10. Database SQL JDBC
11. Design Pattern
12. Development Class
13. EJB3
14. Email
15. Event
16. File Input Output
17. Game
18. Generics
19. GWT
20. Hibernate
21. I18N
22. J2EE
23. J2ME
24. JDK 6
25. JNDI LDAP
26. JPA
27. JSP
28. JSTL
29. Language Basics
30. Network Protocol
31. PDF RTF
32. Reflection
33. Regular Expressions
34. Scripting
35. Security
36. Servlets
37. Spring
38. Swing Components
39. Swing JFC
40. SWT JFace Eclipse
41. Threads
42. Tiny Application
43. Velocity
44. Web Services SOA
45. XML
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java » Collections Data Structure » ArrayScreenshots 
Clone Array

public class CloneArray {
  public static void main(String args[]) {
    int array1[] 1234};
    int array2[] 12345678};
    System.out.println("Original size: " + array1.length);
    System.out.println("New size: " + cloneArray(array1).length);
    System.out.println("Original size: " + array2.length);
    System.out.println("New size: " + cloneArray(array2).length);
  }

  static int[] cloneArray(int original[]) {
    return (int[]) original.clone();
  }
}


           
       
Related examples in the same category
1. Initialization and re-assignment of arraysInitialization and re-assignment of arrays
2. Custom ArraySet implementationCustom ArraySet implementation
3. Custom ArrayMap implementationCustom ArrayMap implementation
4. Doubling the size of an arrayDoubling the size of an array
5. Using reflection to check array type and lengthUsing reflection to check array type and length
6. Using reflection to create, fill, and display an arrayUsing reflection to create, fill, and display an array
7. ArrayEnumeration classArrayEnumeration class
8. Timing array loop performance
9. Treating an Array as an Enumeration
10. Converting a Collection to an ArrayConverting a Collection to an Array
11. Array 2DArray 2D
12. Can you change the .length of an array
13. Show Two-Dimensional Array of Objects
14. ArrayListDemo done over using an ArrayList
15. Array Hunt game
16. Multi Dimension Array
17. Associates keys with valuesAssociates keys with values
18. Arrays of primitives
19. Creating arrays with new
20. Array initialization
21. Creating an array of nonprimitive objects
22. Create multidimension arraysCreate multidimension arrays
23. Initializing Array ValuesInitializing Array Values
24. Creating a Two-Dimensional Array
25. Initializing a Two Dimensional ArrayInitializing a Two Dimensional Array
26. Using the length VariableUsing the length Variable
27. Triangular array
28. Grow arrayGrow array
29. Define array for class Define array for class
30. String array and output to consoleString array and output to console
31. Multiply two matrices
32. Array Of Arrays Demo 2Array Of Arrays Demo 2
33. Array Copy DemoArray Copy Demo
34. Java program to demonstrate multidimensional arraysJava program to demonstrate multidimensional arrays
w___w__w__.___ja__v_a2_s__.c__om__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.