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();

        baos.write(75);

        String str = baos.toString();
        System.out.println("Before Resetting : " + str);

        baos.reset();

        baos.write(65);

        str = baos.toString();
        System.out.println("After Resetting : " + str);

    }
}