Write program to print Hello World and print each character
address in that string and print how many times each
character is in that string?
Ex: H: 0 & 1
e:1 & 1
l :2,3,8 & 3
o:4,6 & 2
w:5 & 1
r: 7 & 1
d 9 & 1

Answer Posted / noor

Little change in the code

add this for loop
for (int x = i - 1; x >= 0; x--)

instead of
for (int x = i - 1; x > 0; x--)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What about anonymous inner classes in java?

559


How do you add an element to a set in java?

491


What is difference between filereader and bufferedreader?

525


What happens if an exception is throws from an object's constructor?

621


How variables are declared?

510






What is difference between == equals () and compareto () method?

526


Why is java not 100% pure oops?

608


What is the advantage of functional interface in java 8?

511


What will be the initial value of an object reference which is defined as an instance variable?

627


Can a static method be final?

548


What is a literal coding?

508


Can we use string in the switch case?

569


Which is the best approach for creating thread ?

711


What are mutable classes?

517


What are classloaders?

593