I validate but now i delete from QuestionFileOutputStream
implement AmigoOutputStream
and I delete every @Override above implement methods. Now looks like program worked the same. What's different if any is? I think I do now classic wrapper class without inheritance AmigoOutputStream interface? Tell me what you think becouse it's new to me.
package com.codegym.task.task18.task1812;

import java.io.*;

/*
Extending AmigoOutputStream

*/

public class QuestionFileOutputStream  {

    private AmigoOutputStream amigo;

    public QuestionFileOutputStream(AmigoOutputStream amigo) {
        this.amigo = amigo;
    }

    public void flush() throws IOException {
        amigo.flush();

    }


    public void write(int b) throws IOException {
        amigo.write(b);
    }


    public void write(byte[] b) throws IOException {
        amigo.write(b);
    }


    public void write(byte[] b, int off, int len) throws IOException {
        amigo.write(b, off, len);
    }


    public void close() throws IOException {
        System.out.println("Do you really want to close the stream? Y/N");
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String line = "";
        if ((line = reader.readLine()).equals("Y")) {
            amigo.close();
        }
    }
}
package com.codegym.task.task18.task1812;

import java.io.IOException;

public interface AmigoOutputStream {
    void flush() throws IOException;

    void write(int b) throws IOException;

    void write(byte[] b) throws IOException;

    void write(byte[] b, int off, int len) throws IOException;

    void close() throws IOException;
}
package com.codegym.task.task18.task1812;

import java.io.IOException;

public class Solution {
    public static void main(String[] args) throws IOException {
        AmigoOutputStream amigoOutputStream = new AmigoOutputStream() {
            @Override
            public void flush() throws IOException {

            }

            @Override
            public void write(int b) throws IOException {

            }

            @Override
            public void write(byte[] b) throws IOException {

            }

            @Override
            public void write(byte[] b, int off, int len) throws IOException {

            }

            @Override
            public void close() throws IOException {

            }
        };
        QuestionFileOutputStream questionFileOutputStream = new QuestionFileOutputStream(amigoOutputStream);
        questionFileOutputStream.close();
    }
}