public class SNums { private int[] nums; public SNums(int nNums) { nums = new int[nNums]; for (int i = 0; i < nNums; i++) nums[i] = nNums*i; } @Override public String toString() { return "(" + nums[0] + ", " + nums[nums.length/2] + ", " + nums[nums.length-1] + ")"; } public static void main(String[] args) { SNums nums = new SNums(10); System.out.println(nums); } }