Question: Exercise #2 Given the following classes public class String1 extends Object { private char|| str; private int size: public String1 () { size =
Exercise #2 Given the following classes public class String1 extends Object { private char|| str; private int size: public String1 () { size = -1; str= new char[80]; } public void Append (char c) { size++; str[size] = c; } public char Remove (){ char c=> str/size]; size--: return(c); }} a) Define a method updateLast that updates the last character in the string input: char x output: none b) Define a method Remove_first that removes and returns the first character in the string input: none output: char x
Step by Step Solution
There are 3 Steps involved in it
a updateLast method updates the last character in the string with the ... View full answer
Get step-by-step solutions from verified subject matter experts
