object oriented approach in simple program : <p>I'm trying to make a simple program with Student class and several methods in main class doing job (list, create and Write to file, del item, add item, search and sort items). 
it's running good but,
I wish to have it in more 'clean way' or 'object oriented' way so to speak.
Any ideas how to improve it a bit?
Below is the code.
Thanks for any suggestions!</p>

<pre><code>public class SimpleDB {

static FileWriter fstream;
static BufferedWriter out;
public static ArrayList&lt;Student&gt; students;
static Scanner menuSc;
static File file;
static Scanner nameOfFile;
static FileWriter wr;
static Scanner addNameAndEmail;
static Scanner sort;
static Scanner search;

public static void createWriteToFile() {
    try {

        String aktDir = System.getProperty("user.dir");// the directory where app (java) was started (working dir)
        //System.out.println("Aktual dir&gt;" + aktDir);
        System.out.println("Please enter name of file ...\n");
        nameOfFile = new Scanner(System.in);
        String nof = nameOfFile.nextLine();

        file = new File(nof);
        if (!file.exists()) {
            System.out.println("Creating new file : " + nof);
        }
        try {    //create new file
            file.createNewFile();
        } catch (IOException ex) {
            Logger.getLogger(SimpleDB.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("Writing to file " + nof);
        try {
            wr = new FileWriter(nof);
        } catch (IOException ex) {
            Logger.getLogger(SimpleDB.class.getName()).log(Level.SEVERE, null, ex);
        }
        for (Student stu : students) {
            try {
                wr.write(stu.toString());
            } catch (IOException ex) {
                Logger.getLogger(SimpleDB.class.getName()).log(Level.SEVERE, null, ex);
            }

        }
        wr.close();
    } catch (IOException ex) {
        Logger.getLogger(SimpleDB.class.getName()).log(Level.SEVERE, null, ex);
    }
}

public static void sort() {
    boolean b = true;
    while (true) {
        System.out.println("Sorting&gt; by name: type N, by email: type E, for exit: type X \n");
        sort = new Scanner(System.in);
        String s = sort.nextLine();
        switch (s) {

            case "N":
                System.out.println("Sorting by name....: \n");
                students.sort((Student s1, Student s2) -&gt; {
                    return s1.getName().compareToIgnoreCase(s2.getName());
                });

                System.out.println("Sorted by name&gt; \n" + students);
                break;

            case "E":
                System.out.println("Sorting by mail....: \n");
                students.sort((Student s1, Student s2) -&gt; {
                    return s1.getEmail().compareToIgnoreCase(s2.getEmail());
                });
                System.out.println("Sorted list&gt; \n" + students);
                break;
            case "X":
                System.out.println("Returning to main menu...");
                b = false;
                return;

            default:
                System.out.println("Please enter correct choice! ");
                break;

        }

    }
}

public static void search() {
    System.out.println("Enter a name you want to search&gt;  \n");
    search = new Scanner(System.in);
    boolean bol = false;
    String se = search.next();
    for (int i = 0; i &lt; students.size(); i++) {
        if (se.equalsIgnoreCase(students.get(i).getName())) {
            bol = true;
            break;
        }
    }
    if (bol) {
        System.out.println("found");
    } else {
        System.out.println("not found");

    }
}

private static void add() {
    addNameAndEmail = new Scanner(System.in);
    System.out.println("Please enter a name: ");
    String n = addNameAndEmail.nextLine();

    System.out.println("Please enter an email: ");
    String e = addNameAndEmail.nextLine();

    students.add(new Student(n, e));
    System.out.println("\n" + "new student " + students);
}

public static void list() {
    System.out.println("List of Students&gt; ");
    String l = null;
    for (Student stu : students) {
        System.out.println(stu);

    }

}

public static char menu() {
    System.out.println(""
            + " 'A' list, 'B' add, 'C' save to file, 'D' search, 'E' sort data, 'F' exit from program &gt; ");
    menuSc = new Scanner(System.in);
    String c = menuSc.nextLine();
    if (c.isEmpty()) {
        return ' ';
    } //Files.copy(null, null, options) 
    return c.toUpperCase().charAt(0);
}

public static void main(String[] args) throws IOException {

    // some students added
    students = new ArrayList&lt;&gt;();
    students.add(new Student("alan", "alan@gmail.com"));
    students.add(new Student("michael", "michael@gmail.com"));
    students.add(new Student("peter", "peter@gmail.com"));
    students.add(new Student("andrew", "andrew@gmail.com"));
    boolean a = true;
    while (a = true) {

        char c = menu();

        switch (c) {

            case 'A':
                list();
                break;
            case 'B':
                add();
                break;
            case 'C':
                createWriteToFile();
                break;
            case 'E':
                sort();
                break;
            case 'D':
                search();
                break;
            case 'F':
                System.out.println("Good Bye!");
                a = false;
                return;

        }

    }

}
}
</code></pre>
