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, 23.06.2019 20:40
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
question
Computers and Technology, 24.06.2019 00:30
Setting up a home network using wireless connections is creating a a. vpn b. lan c. wan d. mini-internet
Answers: 2
question
Computers and Technology, 24.06.2019 00:40
What is the error in the following pseudocode? module main() call raisetopower(2, 1.5) end module module raisetopower(real value, integer power) declare real result set result = value^power display result end module
Answers: 1
question
Computers and Technology, 24.06.2019 19:50
Which is a characteristic of free and open-source software licenses? a. the source code is unavailable to everyone b. the source code is available only to the government c. the source code is available to all users d. the source code is constantly modified
Answers: 1
You know the right answer?
Stringset. java
can you me fix my java code?
earlier we wrote a class stringset. that...
Questions