Answered step by step
Verified Expert Solution
Link Copied!

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

  1. 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.
  2. 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.
  3. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions