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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!