subject

Stringset. java
can you me fix my java code?
earlier we wrote a class stringset. that program's original specification is included for convenience:
write a class stringset. a stringset object is given a series of up to 10 string objects. it stores these strings (or a reference to them, to be precise) and can perform limited calculations on the entire series.
the stringset class has the following specification:
// a single instance variable of type string[]
// an int instance variable that indicates the number of string objects that the stringset currently contains
// a single no-argument constructor
// a mutator that adds a string newstr to the stringset object
void add(string newstr)
// an accessor that returns the number of string objects that have been added to this stringset object
int size()
// an accessor that returns the total number of characters in all of the strings that have been added to this stringset object
int numchars()
// an accessor that returns the number of strings in the stringset object that have exactly len characters
int countstrings(int len)
write a class stringsettester that has a main method. it should ask the user for the number of strings to add to a stringset object,
query the user for each string (use scanner's nextline method), and afterward use stringset's add, size and numchars methods to print information
about the collection of strings entered. also print the number of strings that are exactly 5 and 7 characters long.
reimplement stringset with the exception that it should now extend arraylist instead of encapsulating a string[]. you can easily abolish the 10 string limit for this new stringset. you can also remove the int instance variable, as your class will no longer need it. your existing stringsettester should work with the new stringset without being changed.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
This is not a factor that you should use to determine the content of your presentation. your audience your goals your purpose your technology
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
You know the right answer?
Stringset. java
can you me fix my java code?
earlier we wrote a class stringset. that...
Questions
Questions on the website: 13722367