Language: Java

import java.util.Scanner;

public class Main {
    int i;
    int n;
    int x;
    String result;
    StringBuilder writeBuilder;
    StringWriter stringWriter;
    BufferedWriter bufferedWriter;
    public Main(){
        this.n = 0;
        this.i = 1;
        this.x = 0;
        this.result = "";
        this.writeBuilder = new StringBuilder();
        this.stringWriter = new StringWriter();
        this.bufferedWriter = new BufferedWriter(this.stringWriter);
    }
    public static void main(String[] args) throws IOException {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        ITP1_5_D problem = new Main();
        problem.call(n);
    }

    public void call(int n) throws IOException {
        
        this.n = n;
        checkNum();
        this.writeBuilder.append("\n");
        this.result += "\n";
        System.out.println(this.writeBuilder);
       // bufferedWriter.(this.writeBuilder.toString());   //does not display
    }

    public void checkNum() throws IOException {
        x = i;
        if (x % 3 == 0) {
            this.writeBuilder.append(" ");
            this.writeBuilder.append(String.valueOf(i));
            result += " " + i;
            endCheckNum();
        }
        include3();
    }

    public void include3() throws IOException {
        if (x % 10 == 3 && i <= n) {
            this.writeBuilder.append(" ");
            this.writeBuilder.append(String.valueOf(i));
            this.result += " " + i;
            endCheckNum();
        }
        x /= 10;
        if (x != 0) {
            include3();
        }
        endCheckNum();

    }

    public void endCheckNum() {
        if (++i <= n) {
            checkNum();
        }
    }
}



Compiler output:
Main.java:9: error: cannot find symbol
    StringWriter stringWriter;
    ^
  symbol:   class StringWriter
  location: class Main
Main.java:10: error: cannot find symbol
    BufferedWriter bufferedWriter;
    ^
  symbol:   class BufferedWriter
  location: class Main
Main.java:20: error: cannot find symbol
    public static void main(String[] args) throws IOException {
                                                  ^
  symbol:   class IOException
  location: class Main
Main.java:27: error: cannot find symbol
    public void call(int n) throws IOException {
                                   ^
  symbol:   class IOException
  location: class Main
Main.java:37: error: cannot find symbol
    public void checkNum() throws IOException {
                                  ^
  symbol:   class IOException
  location: class Main
Main.java:48: error: cannot find symbol
    public void include3() throws IOException {
                                  ^
  symbol:   class IOException
  location: class Main
Main.java:17: error: cannot find symbol
        this.stringWriter = new StringWriter();
                                ^
  symbol:   class StringWriter
  location: class Main
Main.java:18: error: cannot find symbol
        this.bufferedWriter = new BufferedWriter(this.stringWriter);
                                  ^
  symbol:   class BufferedWriter
  location: class Main
Main.java:23: error: cannot find symbol
        ITP1_5_D problem = new Main();
        ^
  symbol:   class ITP1_5_D
  location: class Main
9 errors