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
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