Question: class Student { String gender: void setGender (String g) ( this.gender = s; } } a. How do you make the instance variable gender accessible

 class Student { String gender: void setGender (String g) ( this.gender

class Student { String gender: void setGender (String g) ( this.gender = s; } } a. How do you make the instance variable gender accessible only to Student class? Add the Java code below, Make sure the variable name follows Java convention for constants (5 points) class Student { String gender; void setGender (String g) ( this.gender = s; } } b. How do you access the gender variable/property after (a) above? Add the Java code below (10 points) class Student { String gender; void setGender (String g) ( this.gender = s; } // write the code below

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!