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

Java:

Computers and Technology
1 answer:
Agata [3.3K]3 years ago
5 0

Answer:

import java.util.*;

public class work {

// function for counting unique character

public static int numUnique(String input) {

boolean[] list = new boolean[Character.MAX_VALUE];

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

list[input.charAt(i)] = true;

}

int count = 0;

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

if (list[i] == true){

count++;

}

}

return count;

}

public static void main(String args[])

{

List<String>list=new ArrayList<>(); // creatng array list of type string

list.add("abcdef");

list.add("aaabcd");

list.add("bccddee");

list.add("abcddd");

list.add("a");

for(String str:list)

{

// for printing the results

System.out.println("given string : "+ str+" , number of unique values :"+numUnique(str));

}

}

}

Explanation:

You might be interested in
What kind of command can you access from the mini toolbar in Microsoft Word?
qaws [65]
Paint,calculator,camera,snipping tool,file,store,and photis

5 0
2 years ago
Write one for loop to print out each element of the list several things. then write another for loop
Kay [80]

Question:

Write one for loop to print out each element of the list several_things. Then, write another for loop to print out the TYPE of each element of the list several_things.

Answer:

The solution in python is as follows:

for element in several_things:

    print(element)

   

for element in several_things:

    print(type(element))

Explanation:

The solution assumes that the list several_things has already been initialized.

So, the rest of the code is explained as follows:

This line iterates through the list, several_things

for element in several_things:

This line prints each element

    print(element)

This line iterates through the list, several_things for the second time    

for element in several_things:

This line prints the type of each element

    print(type(element))

6 0
2 years ago
Which of the following statements about crane hand signal training are true? A. Both statements are true about crane hand signal
Alenkinab [10]
The correct option is A.
When using crane at a construction site, it is required that:
1.A poster should be posted at the job site with an illustration of the hand signals that every operator and personnel working with the crane and around the crane must know.
2. Hand signals for crane and derrick operators should be those set by the American National Standard institute customize for the type of crane in use.<span />
5 0
3 years ago
Which of the following is not an ideal habitat for a strong time-management plan
Maurinko [17]
The answer to this question is, A. Cramming.


PLEASE MARK BRAINLIEST!! :)
5 0
3 years ago
Read 2 more answers
I WILL STAR YOU AND THANKS YOU!!!!!!!!!!!!!!!!
lord [1]
The answer seems to be polymerization.
 
8 0
3 years ago
Other questions:
  • If you want to place the insertion point in a cell to edit a specific part of its contents, you can
    5·1 answer
  • Write a program that unpickle's employee dictionary and while reading from the dictionary, it allows users to lookup an employee
    9·1 answer
  • An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation
    9·1 answer
  • In what ways do you think the media should function in a democratic society?
    9·1 answer
  • You are creating a story map about Mexico. After configuring the web app template, you launch the app to test it. When the app o
    13·1 answer
  • How does computer applications affect our lives daily? 1- paragraph (4 sentences)
    8·2 answers
  • If we need to manage a contiguous range of memory, handling requests to allocate various sized chunks, and later make those chun
    12·1 answer
  • Edge is a video game featuring interactive extreme sports. The graphics used in the game are protected by
    8·1 answer
  • Please help me on this match all this up i’ll give you brainlist
    13·2 answers
  • What is the greatest number of bits you could borrow from the host portion of a class B subnet mask and still have at least 130
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!