Question: in Java: 4) Write a method createId declared as follows: public static String createID (String firstName, String lastName) {... It should return a string consisting
in Java:

4) Write a method createId declared as follows: public static String createID (String firstName, String lastName) {... It should return a string consisting of the first initial, followed by the last name, followed by a randomly generated number between 1 and 50 (all lower case). E.g. for input Steve Kautz the return value would look like "skautz42". The number should be generated with an instance of java.util.Random, using the nextInt() method. (Note that since this method is static and needs no instance variables, we don't have to worry here about what class it is defined in.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
