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
Can the garbage collection be forced by any means?
What is a short in java?
What does exclamation mean in java?
Is an empty arraylist null?
What is lastindexof in java?
Can singleton class be inherited in java?
What is use of inner class in java?
What is oops in java?
What is replaceall in java?
What is compareto?
What is a class variable?
Are variables stored in ram?
What is type conversion in java?
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.
What are classloaders?