Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

aabccdee
Find the used alphabets as abcde ?

Answer Posted / hitesh

public static void main(String[] args) {

String s1 = "aaabbccccaaa";
String s2 = " ";
for (int i = 0; i < s1.length(); i++) {
if (i == 0) {
s2 = s2.concat("" + (s1.charAt(i)));
}

if (s2.contains(s1.charAt(i) + "")) {
continue;
} else {
s2 = s2.concat("" + (s1.charAt(i)));
}
}
System.out.println(s2);
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Give any two differences between C++ and java.

1198


How do you reverse sort in java?

996


How many types of voids are there?

1022


What is assembly used for?

1057


What are scalar data types?

1124


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

1016


What is entry set in java?

1229


Explain notifyall() method of object class ?

1135


What is role of void keyword in declaring functions?

1091


What is the collections api in java programming?

1024


What is the difference between the prefix and postfix forms of the ++ operator?

1056


What are peerless components?

1140


What must a class do to implement an interface in java programming?

1127


Explain about the select method with an example?

1228


How to add menushortcut to menu item?

1040