forked from serkanhelvacioglu/Java-IAU
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMain.java
More file actions
37 lines (28 loc) · 788 Bytes
/
Main.java
File metadata and controls
37 lines (28 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package workingexampleweek6;
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args)throws IOException {
File file1=new File("E:\\users\\ugurcankeser\\desktop\\Student.txt");
FileWriter fwrite=new FileWriter(file1);
BufferedWriter bfwrite= new BufferedWriter(fwrite);
Student std=new Student();
std.setname();
std.setsurname();
std.setNumber();
std.setdepartmant();
bfwrite.write(std.getname());
bfwrite.newLine();
bfwrite.write(std.getsurname());
bfwrite.newLine();
bfwrite.write(std.getdepartmant());
bfwrite.newLine();
bfwrite.write(std.getNumber());
bfwrite.newLine();
bfwrite.close();
Scanner scn=new Scanner(file1);
while(scn.hasNext()){
System.out.println(scn.nextLine());
}
}
}