Question: Java: In HW3 there was a method called public boolean isValidHobby(): Code from homework 3 below package ch3.defaultValidate; public class RequestDataDefault { protected String hobby;

Java: In HW3 there was a method called public boolean isValidHobby():

Code from homework 3 below

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(""); } }

write a pseudo code of what a method called isValidPhoneNumber() would look like;

(must have at least 2 validation checks)

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!