println Array - Java java.lang

Java examples for java.lang:int Array

Description

println Array

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        Object[] arg = new String[] { "1", "abc", "level", null,
                "java2s.com", "asdf 123" };
        printlnArray(arg);/*from   www  . ja va 2  s. com*/
    }

    public static void printlnArray(Object[] arg) {
        for (int i = 0; i < arg.length; i++) {
            System.out.println(arg[i]);
        }
    }

    public static void printlnArray(int[] arg) {
        for (int i = 0; i < arg.length; i++) {
            System.out.println(arg[i]);
        }
    }

    public static void printlnArray(double[] arg) {
        for (int i = 0; i < arg.length; i++) {
            System.out.println(arg[i]);
        }
    }

    public static void printlnArray(boolean[] arg) {
        for (int i = 0; i < arg.length; i++) {
            System.out.println(arg[i]);
        }
    }
}

Related Tutorials