print int array out - Java java.lang

Java examples for java.lang:int Array

Description

print int array out

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        int[] array = new int[] { 34, 35, 36, 37, 37, 37, 67, 68, 69 };
        print(array);//from w  w  w  .  ja  va2 s . co  m
    }

    public static void print(int[] array) {
        System.out.print("{ " + array[0]);
        for (int i = 1; i < array.length; i++) {
            System.out.print(", " + array[i]);
        }
        System.out.println(" }");
    }
}

Related Tutorials