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 is considered an anti pattern?

531


How do you sort in descending order in java using collections sort?

499


Can we define package statement after import statement in java?

558


Write a java program to print fibonacci series?

542


What is the relationship between clipping and repainting under awt?

616






What lambda means?

545


what do you understand by synchronization? : Java thread

551


What is the default access specifier for variables and methods of a class?

570


What is predicate in java?

560


What are the different tags provided in jstl?

553


What is a copy constructor in java?

580


What function extracts specified characters from a string?

567


What are pass by reference and pass by value?

529


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

9241


Why do we need hashset in java?

504