0

ObjectOutputStream ObjectInputStream

Given the following user-defined class named student (default package): Student.java import java.io.Serializable; public class Student implements Serializable( public String name; public String matricNo; public Student(String name, String matricNo) { this.name = name; this.matricNo = matricNo; } Given a data file, named studentcgpa.dat (refer file attached) consists of a few records Each record encompasses id, student, gpa and cgpa. The data types for each attribute are as follows: studentcepa.dat <id> : int <student> 1 Student <gpa> : double <cepa> : double Read the given data file studentcgpa.dat using objectInputstream class, display on console and write the following information to a file named studentresult.dat using ObjectOutputStream class: • Students' name and matric no, whose gpa and cgpa is greater than 2.5. • Number of student with cgpa greater than or equal to 3.5. I got confused how many class should i have and is it attribute in student class not same as obj

29th Dec 2019, 4:10 PM
Ain Syaheera
Ain Syaheera - avatar
1 Odpowiedź
29th Dec 2019, 4:38 PM
Avinesh
Avinesh - avatar