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
Why Set interface contains unique elements, what internally implemented for this so that it contains unique elements?
Explain the advantages of packages in java?
Can keyword be used as identifier?
How we can make copy of a java object?
What are the ways to instantiate the class class?
How many types of flags are there?
What does function identity () do?
What is the java project architecture?
How to declare an arraylist in java?
What is a instance variable?
when you will synchronize a piece of your code? : Java thread
What is Java Shutdown Hook?
What is a subsequence of a string?
Where can i get Latest SUN Certification Dumps and what are the Sun Certification Codes that are available, Im new to JAVA, so please gimme info as i need to write J2EE - Core Java Certification
Can a abstract class be defined without any abstract methods?