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
Irina18 [472]
2 years ago
7

JAVA

Computers and Technology
1 answer:
avanturin [10]2 years ago
3 0

Answer:

   public ArrayList onlyBlue(String[] clothes){

       ArrayList<String> blueCloths = new ArrayList<>();

       for(int i =0; i<clothes.length; i++){

           if(clothes[i].equalsIgnoreCase("blue")){

               blueCloths.add(clothes[i]);

           }

       }

       return blueCloths;

   }

Explanation:

  • Create the method to accept an Array object of type String representing colors with a return type of an ArrayList
  • Within the method body, create and initialize an Arraylist
  • Use a for loop to iterate the Array of cloths.
  • Use an if statement within the for loop to check if item equals blue and add to the Arraylist.
  • Finally return the arrayList to the caller
You might be interested in
When you add encryption to a powerpoint presentation what does it do
abruzzese [7]

Answer: your document will be inaccessible

5 0
2 years ago
Write a function named shareALetter that takes one parameter, wordList – a list of words. Create and return a dictionary in whic
Arte-miy333 [17]
Can u send anything to understand it
7 0
2 years ago
Which is used to identify the network portion and the host portion of an ip address?
qwelly [4]
<span>subnet mask is used to identify the network portion and the host portion of an ip address.</span>
3 0
3 years ago
2. A shift register can operate:
Naddik [55]
C. Both serially and Perullo
8 0
2 years ago
West Point Bridge Designer | Does anyone know a way to make this bridge cost less?
e-lub [12.9K]
Make the zig zag part more spaced out
4 0
2 years ago
Other questions:
  • Name size of machine screw that is used to secure switches and receptacles to device boxes
    13·1 answer
  • The approved systems design document is used by programmers, the personnel department, and information systems personnel.
    8·1 answer
  • Assume that play_list refers to a non-empty list, and that all its elements are integers. Write a statement that associates a ne
    7·1 answer
  • A user makes a request to implement a patch management service for a company. As part of the requisition the user needs to provi
    7·1 answer
  • What are the two major components of a processor cooler assembly?
    15·1 answer
  • Which of the following information would best be displayed throughout the use of a time line
    11·1 answer
  • Which country was the first in the world to launch a mass media campaign in response to population growth?
    14·1 answer
  • Because people can easily upload information and share online, they tend to:
    15·1 answer
  • What are the 3 dimension of an information system?
    13·1 answer
  • If your computer determines the destination address of a network packet is to a remote network.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!