Question
Write a pseudocode based on the following java code: package ch3.defaultValidate; public class RequestDataDefault { protected String hobby; protected String aversion; public void setHobby(String hobby)
Write a pseudocode based on the following java code:
package ch3.defaultValidate;
public class RequestDataDefault { protected String hobby; protected String aversion; public void setHobby(String hobby) { this.hobby = hobby; } public String getHobby() { if (isValidHobby()) { return hobby; } return "No Hobby"; } public void setAversion(String aversion) { this.aversion = aversion; } public String getAversion() { if (isValidAversion()) { return aversion; } return "No Aversion"; } public boolean isValidHobby() { return hobby != null && !hobby.trim().equals(""); } public boolean isValidAversion() { return aversion != null && !aversion.trim().equals(""); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started