Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions