Question: Write a java program that generates random string called str of 1 0 characters from the English alphabet ( lower and upper case ) and
Write a java program that generates random string called str of characters from the English alphabet
lower and upper case and then create a new string commStr containing all common, distinct and case
sensitive characters from your First name and str
Note:
Your first name should be stored in a string variable called fName in main method.
Ordering the common letters based on their appearance in the fName.
The program should display:
The string str
Your first name
The longest sequence commStr.
Example:
Suppose the generated random String is "AmedMoXMha"
Name is "Mohamed"
Output: Str "AmedMoXMha"
Name "Mohamed"
commStr "Mohamed"
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
