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
What does the string method compareto () do?
How many bits is a double?
What does i ++ mean in Java?
What do you mean by Hash Map and Hash Table?
What is composition in java?
What is the purpose of the system class in java programming?
How do you calculate square roots?
What is collections framework?
Is a method a function?
What are voids?
What do bitwise operators do?
What is jvm? How its run?
Is it possible to use string in the switch case?
Why synchronization is important in java?
What is java full form?