Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives 1. Writing a class. 2. Putting together a comprehensive set of tests to verify correctness of code written. 3. Reviewing Java primitives Question 1

image text in transcribed
image text in transcribed
image text in transcribed
Objectives 1. Writing a class. 2. Putting together a comprehensive set of tests to verify correctness of code written. 3. Reviewing Java primitives Question 1 Download the MyString,java Java code and write the missing stub-method code so that the program will have the following output NOTE: you are not allowed to use any of the standard built-in String methods except charAtO and length0. I need you implement these methods by yourself Example of correct output for a string such as "Object Oriented" Object Oriented detneirO tcejbo Object Oriented oBJECT oRIENTED Object Oriented ct OrientedObje Object Oriented Hbject Hriented Page | 2 /I MyString.java public class Mystring public String mystring int length-0: Mystring (String s) (this.myString-s; this.length-this.mystring.length):) public void reverse lic void toggle () public void rotate (int oftset) public void replace (char oldchar, char newchar) ( public void print l system.out.printin (mystring)i blic static void main (StringI] args) Mystring sanew Mystring ( object Oriented") MyString snew Mystring ("object oriented") s.print ): //print current default string s.reverse ) s.print 0 s.reverse(): //reverse it back again s.print O s.toggle0: //toggle s.print (0 s.toggle0: //toggle it back again s.print 0 s.rotate(4); s.print ) s.rotate (s.length-4) s.print O s.replaces (O" H) s.print O

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions