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.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.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
Get step-by-step solutions from verified subject matter experts
