Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.nio.ShortBuffer;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        ShortBuffer shortBuffer = ShortBuffer.allocate(10);
        shortBuffer.put((short) 100);

        shortBuffer.rewind();

        ShortBuffer shortBuffer2 = shortBuffer.compact();

        System.out.println(Arrays.toString(shortBuffer2.array()));

    }
}