Write a method called isNameValid() that accepts one String argument, and returns true if the string is a valid name or false otherwise.

Write a method called isNameValid() that accepts one String argument, and returns true if the string
is a valid name or false otherwise.

In this task, you are being asked to write value-returning methods in Java.
Write a method called isNameValid() that accepts one String argument, and returns true if the string
is a valid name or false otherwise.
You may use the following header for this method:
static boolean isNameValid(String name)
The string will be a valid name if it contains letters, spaces and digits, and its length is from 3 to 20
characters (inclusive).

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply