Question: hi need some help with a program, i have got this to setup like this with some help, but how would i change it to

hi need some help with a program, i have got this to setup like this with some help, but how would i change it to the modification listed below, aka best way to do it

Modify the program of Fig. 16.18 to count the number of occurrences of each letter rather than of each word. For example, the string "HELLO THERE" contains two Hs, three Es, two Ls, one O, one T and one R. Display the results.

Run your program with the following string: Hi there, I am taking Java Programming (Intermediate).

import java.util.ArrayList;

import java.util.Collections;

import java.util.LinkedList;

import java.util.List;

public class Generic_Collection {

public static void main(String a[]) {

LinkedList list = new LinkedList();

list.add('F');

list.add('G');

list.add('U');

list.add('V');

list.add('L');

list.add('A');

list.add('I');

list.add('D');

list.add('R');

list.add('P');

System.out.println("Actual LinkedList:" + list);

List listCopied = new ArrayList();

listCopied.addAll(list);

//Reverse the listCopied.

Collections.reverse(listCopied);

System.out.println("List: " + list);

System.out.println("Copy List: " + listCopied);

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!