Question: Java Programming: Write Java Class IsLetterWord with following members: Create default constructor that sets the instance variable 'stringword' to the string defaultstring. Create parameterized constructor

Java Programming:

Write Java Class IsLetterWord with following members:

  • Create default constructor that sets the instance variable 'stringword' to the string "defaultstring".
  • Create parameterized constructor that accepts one String object as a parameter and stores it in the instance variable. The String must consist only of letters: no whitespace, digits, or punctuation. If the String parameter does not consist only of letters, set the instance variable to "defaultstring" instead.
  • A method String toString() that returns the instance variable.
  • NOTES:
  • MUST Use "isletter()"
  • MUST NOT use Regex/Regular Expressions or "matches()"

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!