Hey guy\'s I tried to find a way to hide a string, but the code that I found just work with my application... Is there a way to hide the characters in a string with either <
There are several ways to achieve this, it would depend on your application.
If you want to mask all characters with another character in one fell swoop you can use the String#replaceAll(String regex, String replacement) method: http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#replaceAll(java.lang.String,%20java.lang.String).
This involves using Regular Expressions, for regex you would use [\s\S] which will match any whitespace or non whitespace character. For replacement you use a regular string, not a RegEx. In this case, if you wanted an asterisk, use "*", for hyphen "-", very simple.
All the other methods here work well except the @Roddy of the Frozen Pea and @djc391 ones, so that's why I answered it correctly.
Good luck