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
____________ is a widely accepted international best practices framework for implementing information systems security.
balandron [24]

Answer:

Control Objectives for Information and related Technology (COBIT)

Explanation:

COBIT is a framework developed by the ISACA for managing and supervising Information Technology processes. Such kinds of frameworks allow companies to position themselves with the expectations that they and their clients expect. COBIT's aim is to provide management and business process owners with an IT control and governance model that helps deliver value from IT and identify and handle the IT-related risks. It helps bridge the gap between business needs, control requirements and technical issues. It is a paradigm of control for addressing the IT governance requirements and maintaining the security of knowledge and information systems. COBIT emphasizes on what allows processes to work well.

8 0
4 years ago
When a program is adapted to run on multiple processors in a multiprocessor system, the execution time on each processor is comp
____ [38]
I only need points for my questions
4 0
3 years ago
the process of adjusting an IDPS to maximize its efficiency in detecting true positives, while minimizing both false positives a
Dafna1 [17]

Answer:

Tuning. See explanation below.

Explanation:

Tuning

By definition the tuning is: "the process of adjusting an IDPS to maximize its efficiency in detecting true positives, while minimizing both false positives and false negatives."

And this process is the improvement of system performance in computer science. Usually is related to optimization of a process, when we us tunning, we can follow these steps:

a) Identify which numeric values are acceptable and improve the parameters

b) Take a measure for the system originally and without the tunning in order to have an initial comparative measure

c) Understand that each process have a critical path, we need to identify it.

d) Modify parts who not improve the efficiency of the algorithm

e) Check the performace when we apply modifications

5 0
4 years ago
Which file format should Wilson use for sending these images?
Nuetrik [128]
I can’t see the answer choices but I would like to say it’s JPEG am not sure. Could you at least provide the answer choices? Thanks!
7 0
3 years ago
Read 2 more answers
The operating system provides a ____, which is the means with which you interact with the computer
Soloha48 [4]
One answer could be a GUI = Graphical User Interface (e.g. Windows Explorer).
4 0
4 years ago
Other questions:
  • Prior to the release of a movie, a film studio launches a website that allows people to play online games featuring actors in th
    15·2 answers
  • Filtering removes data from the spreadsheet. A. True B. False
    9·2 answers
  • Which of these is important to consider before believing health or fitness information you find online? Where the information wa
    5·2 answers
  • What is Moore’s law
    11·1 answer
  • 1. Why is it important for IT technicians to keep documentation on computers for which they are
    13·1 answer
  • Which of the following factors will have the greatest impact on your credit score? I. Length of Credit History II. Payment Histo
    6·2 answers
  • The most common Unicode transformation formats are UTF- ______ and UTF-16.
    9·1 answer
  • How to create diagram that demonstrates the step<br> by step procedures in performing a mail merge.
    12·1 answer
  • Shelbi likes to play video games on an old Nintendo video game system. No matter how old the cartridge, when she inserts it into
    11·2 answers
  • In what ways is the human brain like a computer? In what ways is it different?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!