1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
svetlana [45]
3 years ago
12

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. Hint: What type of elements did the original StringSet store? What type of elements will be inserted into our ArrayList superclass? How can we tell Java that our ArrayList will be storing that type of element?
Computers and Technology
1 answer:
kolbaska11 [484]3 years ago
4 0

Answer:

Here is the program for the given question

Explanation:

class StringSet

{

ArrayList<String> arraylist; //a reference variable of ArrayList of generic type String

//A no argument constructor.

public StringSet()

{

arraylist=new ArrayList<String>(); //instantiating the ArrayList object

}

//A mutator that adds a String newStr to the StringSet object.

void add(String newStr)

{

arraylist.add(newStr); // add(String) method to add string to the arraylist

}

//An accessor that returns the number of String objects that have been added to this StringSet object.

int size()

{

return arraylist.size(); // size() method which gives the number of elements in the list

}

//An accessor that returns the total number of characters in all of the Strings that have been added to this StringSet object.

int numChars()

{

int sum = 0;

for(String str:arraylist) //for-each loop; can be read as for each string in arraylist

{

sum+=str.length();

}

 

return sum;

}

//An accessor that returns the number of Strings in the StringSet object that have exactly len characters.

int countStrings(int len)

{

int count = 0;

for(String str:arraylist)

{

if(str.length() == len)

count++;

}

return count;

}

}

You might be interested in
The chain of _____ documents that the evidence was under strict control at all times and no unauthorized person was given the op
Arturiano [62]

Answer:

custody.

I hope I could help

4 0
1 year ago
Which of the following is NOT something you can specify in the bullets and numbering dialog box?
geniusboy [140]

type tool?? not postive


4 0
3 years ago
A technician is tasked to implement a wireless router that will have the fastest data transfer speed at 5 GHz frequency. Which o
Basile [38]

Answer:

Option B i.e.,802.11ac is the correct option.

Explanation:

Because 802.11ac is that standard that is selected by the technician to install that router which is wireless and that router has the fastest speed of the data transfering that is 5GHz frequency. Mostly, the following standard is used in the large organizations by which the work done on time without any restriction to access the internet. So, that's why the following option is correct.

7 0
3 years ago
Which media vehicle uses the Dreamweaver software for its design? A(n) "blank" uses the Dreamweaver software for its design.
Inessa [10]
Answer: Websites

Explanation: Adobe Dreamweaver CC is a web design and an Integrated Development Environment (IDE) application that is used to develop and design websites.
3 0
3 years ago
50 POINTS!!!
ycow [4]

Answer:

1. -> B.

2. -> C

3. -> A

Explanation:

1. Antennas = help the router fetch and transmit a signal

2. Repeaters = help in increasing the range of signal

3. Adapters = help the device detect a wireless signal

7 0
3 years ago
Other questions:
  • What type of data visual would you use to illustrate trends over time? Gantt chart Bar graph Line chart Scatter diagrams
    5·1 answer
  • The Modified Greiss chemical test is used to detect the presence of what chemicals that indicate muzzle to target distance?
    11·1 answer
  • Which type of computer graphic can be blown up to a much larger size without getting distorted or losing quality?
    5·1 answer
  • I need some asap pls
    9·2 answers
  • How do you give brianliest
    13·1 answer
  • What game is this?????????????????????
    15·1 answer
  • What is the extension of a Microsoft access database 2013​
    7·2 answers
  • Select the three concepts of capital outlay.
    15·1 answer
  • PLEASE HELP! WILL MARK AS BRAINLIEST!
    6·2 answers
  • John has recently retired from an administrative, yet technical job which he held for 40 years. He decided to pursue a life-long
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!