I have this code:
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.Date;
public class EmployeeProcessor {
public static void main(String[] args) {
Employee employee = new Employee();
employee.lastName = "Smith";
employee.firstName = "Adam";
employee.id = 123456789;
employee.salary = 50000;
try(FileOutputStream fileOutStr = new FileOutputStream("Employee.ser");
ObjectOutputStream objectOutStr = new ObjectOutputStream(fileOutStr)) {
objectOutStr.writeObject(employee);
System.out.println("An employee is externalized into the file Employee.ser");
} catch (IOException ioError){
ioError.printStackTrace();
}
}
}
But in Intellij IDEA ObjectOutputStream
class is strikethrough Like this:
screenshot. When pointing mouse pointer over - this message appears: 'java.io.ObjectOutputStream' is deprecated
. What does it mean?
When I run this code, IntelliJ opens "Edit Configurations" windows asking me to introduce VM options. But I leave it blank and run anyway.