Question: Given Code in Java: public class Student { // TODO: Build Student class with private fields and methods listed above // TODO: Define two private

Given Code in Java:
public class Student { // TODO: Build Student class with private fields and methods listed above
// TODO: Define two private member fields public Student() { // TODO: Define default constructor } public void setName(String n) { // TODO: Assign parameter to instance field } // TODO: Add three more methods public static void main(String[] args) { Student student = new Student(); System.out.println(student.getName() + "/" + student.getGPA()); student.setName("Felix"); student.setGPA(3.7); System.out.println(student.getName() + "/" + student.getGPA()); } }
Build the Student class with the following specifications: Private fields String name - Initialized in default constructor to "Louie" o double gpa - Initialized in default constructor to 1.0 Default constructor Public member methods o setName() & getName o setGPA & getGPAO
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
