Posts by Rodrigo Sasaki • 1,928 points
5 posts
-
6
votes4
answers2972
viewsA: Convert data to Timezone
As you already have the identification of TimeZone correct, that in the case is the BRT you could ignore the part that has the GMT-0300, because putting GMT in format can be problematic unless it is…
-
4
votes3
answers15299
viewsA: Avoiding "!= null" comparison in Java
Complementing the above answers, I have one more suggestion. It runs a long way from what you normally see in Java, but it’s very interesting. The API Google Guava, which is another one of those…
-
14
votes4
answers106387
viewsA: How to compare Strings in Java?
Just complementing @Math’s reply The objects of the class String has an interesting feature. the JVM keeps a string pool, where it stores the Strings that have passed your code, to avoid having to…
-
75
votes2
answers39510
viewsA: How to remove accents and other graphic signals from a Java String?
I use to regex along with the class Normalizer. Thus: public static String removerAcentos(String str) { return Normalizer.normalize(str, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", ""); }…
-
79
votes4
answers107040
viewsA: What is the difference between public, default, protected and private modifiers?
There is no rule, only good practice. Let’s go from the beginning. To begin there are only 3 modifiers (private, protected and public), and with that we have 4 levels of visibility The levels are…