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]
3 years ago
7

JAVA

Computers and Technology
1 answer:
avanturin [10]3 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
A Java programmer has developed a GUI with several different fields for inputting values and indicating choices via buttons, all
stiks02 [169]

Answer:

EventHandler

Explanation:

In order to do this the programmer needs to use the EventHandler class. This class allows the computer to listen for certain user actions such as pressing a button. Using this on a button would then allow the programmer to specify what they want to happen when the user clicks the button or performs a certain action. For example, in this scenario, the programmer would program an EventHandler so that when the button is clicked it saves the input to a variable and changes the input field to the next option.

3 0
3 years ago
Consider the following code segment.
mafiozo [28]

Answer:

for (int h = k; h >= 0; h--)

Explanation:

From the list of given options, option C answers the question.

In the outer loop

Initially, k = 0

In the inner loop,

h = k = 0

The value of h will be printed once because h>=0  means 0>=0 and this implies once

To the outer loop

k = 1

The inner loop will always assume value of k;

So,

h = 1

This will be printed twice because of the condition h>=0  means 1>=0.

Since 1 and 0 are >=0; 1 will be printed twice

To the outer loop

k = 2

The inner loop

h = 2

This will be printed thrice because of the condition h>=0  means 2>=0.

Since 2, 1 and 0 are >=0; 2 will be printed thrice

To the outer loop

k = 3

The inner loop

h = 3

This will be printed four times because of the condition h>=0  means 3>=0.

Since 3, 2, 1 and 0 are >=0; 3 will be printed four times

7 0
3 years ago
Can someone tell me how to fix the keyboard on ipad?- its in the middle of my screen andd i dont know how to do it
mamaluj [8]

Answer:

Here

Explanation:

To move keyboard to bottom of screen, you just need to tap and hold the keyboard icon at the bottom-right corner of the keyboard, choose Dock option. To fix iPad keyboard in middle of screen, please tap and hold the keyboard icon, then choose Dock.Nov 5, 2020

5 0
3 years ago
What steps can be used to password-protect a worksheet?
muminat

Answer:

Review

Changes

Protect sheet

Explanation:

I did it

8 0
3 years ago
Plzzz help! It’s due soon and I can’t figure it out
nignag [31]

Answer:

The answer is A or the first option.

Explanation:

3 0
3 years ago
Other questions:
  • What is a VIN and what role does it play during a criminal investigation? Explain how a VIN could help in a bomb and/or arson ca
    12·1 answer
  • The top of a ladder must extend how many feet above the surface a worker is climbing onto?
    7·1 answer
  • When dealing with a person who is behaving violently you should argue with them. A. False B. True
    5·1 answer
  • How can a professional association help you reach your career goals?
    5·1 answer
  • Which of the following statements is false? a. InputStream and OutputStream are abstract classes for performing byte-based I/O.
    7·1 answer
  • Question 4: What will be the output of the code? Show a complete analysis.
    6·1 answer
  • What is Automation ? Please give an example ?
    14·1 answer
  • Different search engines available on the internet​
    7·1 answer
  • Keira is creating an app for her cross-country team. Users will input their race times and the output will be a graph showing th
    6·1 answer
  • ANs and WANs can be set up in several different shapes, also known as peripherals.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!