aabccdee
Find the used alphabets as abcde ?

Answer Posted / adarsh

Scanner sc=new Scanner(system.in);
Int i,j=0;
String S1=sc.next(),s2;
S2=s1charAt(0);
For(i=1;i<s1.length;i++)
{
If(s2.charAt(j).equals (s1.charAt(i))
Continue;
Else{
S2=s2.concat(s1.charAt(i));
j++;
}
}
Sop(j);
}


I m writing with my mobile phone so chuck the mistakes like upercase nd lowr case...

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can the garbage collection be forced by any means?

530


What is a short in java?

500


What does exclamation mean in java?

573


Is an empty arraylist null?

593


What is lastindexof in java?

548






Can singleton class be inherited in java?

517


What is use of inner class in java?

516


What is oops in java?

565


What is replaceall in java?

545


What is compareto?

544


What is a class variable?

573


Are variables stored in ram?

553


What is type conversion in java?

576


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

1608


What are classloaders?

599