Question: OOP JAVA Exercise 3: Complete the program below in order to make run properly by competing Phone Number methods and add try-catch block in the

 OOP JAVA Exercise 3: Complete the program below in order to OOP JAVA

Exercise 3: Complete the program below in order to make run properly by competing Phone Number methods and add try-catch block in the main method. (Hint: phone number is a String of all numbers and its length is 9 or 10] public class ExceptionWithThrow { public static String validPhoneNum (String name) throws InputMismatchException { // check here if the phone number is valid // throw InputMismatchException if invalid // return the name if it is valid } public static void main(String[] args) { // Ask the user to enter a phone number // check the phone validity through validPhoneNum method // Add try and catch block around appropriate statements }

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!