MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.util.Arrays;

public class MainClass {
    public static void main(String[] a) {
        byte array[] = new byte[10];
        //    Arrays.fill(array, 4); // illegal
        for (int i : array) {
            System.out.println(i);
        }
        Arrays.fill(array, (byte) 4); // Okay
        for (int i : array) {
            System.out.println(i);
        }
    }
}