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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 06:30, messyquestions
Plz 40 points what are raster vectors? a bitmap image a vector file a type of printing press a small projector
Answers: 1
image
Computers and Technology, 22.06.2019 10:40, StephiUnicorni
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
Answers: 1
image
Computers and Technology, 23.06.2019 14:00, ava5015
What is html ? give a small description about html
Answers: 2
image
Computers and Technology, 24.06.2019 11:00, iloveballet1857
Each row in a database is a set of unique information called a(n) ? a.) table. b.) record. c.) object. d.) field.
Answers: 2
You know the right answer?
Stringset. java
can you me fix my java code?
earlier we wrote a class stringset. that...

Questions in other subjects:

Konu
Mathematics, 19.04.2021 23:50
Konu
Mathematics, 19.04.2021 23:50