Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.IOException;
import java.io.OutputStreamWriter;

public class Main {
    public static void reboot() {
        try {
            Process su = Runtime.getRuntime().exec("su");
            OutputStreamWriter out = new OutputStreamWriter(su.getOutputStream());
            out.write("reboot");
            out.flush();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}