Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions

Question

What were Anna Freuds contributions to her fathers theories?

Answered: 1 week ago

Question

What are the different categories of financial instruments?

Answered: 1 week ago