-
Notifications
You must be signed in to change notification settings - Fork 0
/
FirstTest.java
29 lines (21 loc) · 861 Bytes
/
FirstTest.java
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
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;
import java.io.*;
public class FirstTest {
public static void main(String[] args) throws IOException {
Scanner input = new Scanner(System.in);
System.out.print("Name: ");
String name = input.next();
System.out.print("Age: ");
int age = input.nextInt();
System.out.print("Salary: ");
double salary = input.nextFloat();
FileOutputStream archive =
new FileOutputStream("C:\\Users\\meira\\Downloads\\GitHub\\Aprendendo_a_manipular_arquivos\\FirstTest");
DataOutputStream gravador = new DataOutputStream(archive);
String toString = (String) "Name: " + name + ", Age: " + age + ", Salary: " + salary;
gravador.writeUTF(toString);
gravador.close();
}
}