dcsimg
LinkedIn
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Intermediate
Apr 30, 2020

Cloning a Matrix in Java

Cloning a matrix in Java can be done via the clone() method, as below:

int [][] arr = new int[matrix.length][];
for(int i = 0; i      arr[i] = matrix[i].clone();
}
Octavia Anghel
 
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date