Question: Write Java code . Write a class called Q5 that has the following: A static method that checks whether a given String is a valid

Write a class called Q5 that has the following: A static method that checks whether a given String is a valid Irish PPS number: 7 digits followed by either 1 letter or by 2 letters (either upper or lower case); the method should return true if it is valid, false otherwise. The main method that tests the above method in 2 different threads; the threads must be created using anonymous classes where you override the run() as follows: first get the thread to pause for 2 seconds, then print its name; then call the above method in each thread with one of the following strings ("1234567FA" (valid), "123567GN" (not valid), "1200567m" (valid), "1277767zw" (valid), "1234567_A" (not valid)) and output whether the string passed is a valid Irish PPS number. Then in the main thread print the following details of the main thread: name and priority. You must ensure that the 2 threads finish their execution before the main thread is executed.
Step by Step Solution
There are 3 Steps involved in it
public class Q5 public static boolean isValidPPSString pps if ppslength 9 String digits ppssubstring... View full answer
Get step-by-step solutions from verified subject matter experts
