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
Explain the use of javap tool.
Can we create our own daemon thread?
What is the scope or life time of instance variables?
Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?
Can we assign the reference to this variable?
What is string buffer?
What is double parsedouble in java?
How we create object in copy constructor?
How can we make string upper case or lower case?
Why java doesn’t support multiple inheritances?
How to reverse string in java?
What is super constructor?
what are different ways in which a thread can enter the waiting state? : Java thread
What language is an assembler written in?
What are the elements of java?