Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;

public class Main {
    public static void resultToFile(String path) throws FileNotFoundException {
        File file = new File(path);
        PrintStream printStream = new PrintStream(new FileOutputStream(file));
        PrintStream out = printStream;
        System.setOut(out);
    }
}