Here you can find the source of saveMatrixAsADM(AtomicReferenceArray
public static void saveMatrixAsADM(AtomicReferenceArray<AtomicIntegerArray> matrix, String path)
//package com.java2s; //License from project: Open Source License import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.concurrent.atomic.AtomicIntegerArray; import java.util.concurrent.atomic.AtomicReferenceArray; public class Main { public static void saveMatrixAsADM(AtomicReferenceArray<AtomicIntegerArray> matrix, String path) { PrintWriter pw;//from w w w . j a va 2s . c o m try { pw = new PrintWriter(path); } catch (FileNotFoundException e) { e.printStackTrace(); return; } for (int i = 0; i < matrix.length(); i++) { for (int j = 0; j < matrix.length(); j++) { pw.print(matrix.get(i).get(j) + " "); } pw.println(); } pw.close(); } }