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
CSS At-rules provide a way for designers to define "if this, then that" scenarios.
Papessa [141]
True true true true
7 0
3 years ago
The most common types of utility programs fall into these categories.
avanturin [10]

Answer:

file management

Explanation:

correct me if I wrong

7 0
3 years ago
Exercise : Randomizer In this exercise, we are going to create a static class Randomizer that will allow users to get random int
Nutka1998 [239]

Answer:

Here the code is by using java.

Explanation:

//Randomizer.java

public class Randomizer {

public static int nextInt() {

//get random number from 1-10

int randInteger = (int) (Math.random() * (11) + 1);

//if number is greater than 10 or less than 1

while (randInteger > 10 || randInteger < 1) {

randInteger = (int) (Math.random() * (11) + 1);

}

return randInteger;

}

public static int nextInt(int min, int max) {

//formula to get random number from min-max

int randInteger = (int) (Math.random() * (max + 1) + min);

while (randInteger > max || randInteger < min) {

randInteger = (int) (Math.random() * (max + 1) + min);

}

return randInteger;

}

}

//RandomizerTester.java

public class RandomizerTester {

public static void main(String[] args) {

System.out.println("Results of Randommizer.nextInt()");

for (int i = 0; i < 10; i++) {

System.out.println(Randomizer.nextInt());

}

int min = 5;

int max = 10;

System.out.println("\n Results of Randomizer.nextInt(5,10)");

for (int i = 0; i < 10; i++) {

System.out.println(Randomizer.nextInt(min, max));

}

}

}

OUTPUT:

Results of Randommizer.nextInt()

9

2

3

8

5

9

4

1

9

2

Results of Randomizer.nextInt(5,10)

9

8

9

7

5

10

5

10

7

7

4 0
3 years ago
I am buying a BluRay drive access time is 180ms and the other is 210ms(BD-ROM) whats does access time mean
kkurt [141]
It means how fast it can read the disk so if you want faster data transfer you would go for blurry if you really don't care go for the other one
6 0
3 years ago
The goal of an audio codec is
Sloan [31]

If you are looking for what is used for, an audio codec is used for the compression or decompression of digital audio data from a live stream media or an already stored data file.

If you are looking for the purpose, the purpose of using an audio codec is to effectively reduce the size of an audio file without affecting the quality of the sound.

I really hope that this helps you with your question.

7 0
4 years ago
Other questions:
  • Most Answers MOST ANSWERS
    11·2 answers
  • Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. What critical detail must she ha
    14·2 answers
  • When would you use a template when working with word 2013?
    15·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • What is the default view when you first open a PowerPoint presentation
    10·1 answer
  • Five advantages of Internet​
    6·2 answers
  • A_____ handles all the instructions that it received from hardware and software which are available on the computer ​
    10·1 answer
  • Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can
    9·1 answer
  • Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in
    13·1 answer
  • 1. Who is known as the father of a computer?​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!