Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.ByteArrayOutputStream;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        // write byte array to the output stream
        baos.write(55);

        // converts the byte to the default charset value
        String str = baos.toString();

        // prints the string
        System.out.println(str);

    }
}