Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA PROGRAMMING You will create a Java program that will consist of two public classes. One public class will be the AnyString class. This class
JAVA PROGRAMMING
- You will create a Java program that will consist of two public classes. One public class will be the AnyString class. This class will contain data and code to manipulate the data. The second public class will be the TestAnyStringClass. This class will create objects of the AnyString class and test its methods.
- The AnyString class should contain the following:
- An single object/instance variable of type String.
- A constructor method that will accept a single String value and uses it to set the object/instance variable.
- An object/instance method getString() that accepts no argument and returns the object/instance variable value.
- An object/instance method lowercase() that accepts no arguments and returns a String value. The method will return the lowercase value of the object/instance variable.
- An object/instance method uppercase() that accepts no arguments and returns the uppercase value of the object/instance variable.
- An object/instance method getLength() that accepts no arguments and returns the length of the object/instance variable.
- The TestAnyStringClass should contain the following:
- You should input a string.
- Create an object of the AnyString class.
- Call all the methods in the AnyString class, verify that they work, and display the results.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started