Posted In: Java Core, String

When to use StringBuilder vs String concatenation

Most of the discussions say that for few fields String concatenation is fine. If code is looping then do use StringBuilder. Use StringBuilder for following kind of code There is slight different issue with this may be approach. Applications which go through various static code analysis tools should always use StringBuilder append than String concatenation. […]

Read More

by , on August 24th, 2017

Posted In: Caching, Java Core

Do not forget to add serialVersionUID in your POJO

What is a serialVersionUID and why should developer use it in POJO? Why developer should always add serialVersionUID in POJO. In an enterprise application sooner than later you will start using some caching mechanism. Any changes in POJO even if very small can change UID. In such cases all your cached objects will not work. […]

Read More

by , on August 23rd, 2017

Posted In: Date, Java Core

Parsing ISO 8601-compliant String to java.util.Date

Best way to parse an XML dateTime in Java Techniques used 1. JODA Time 2. JAXB  

Read More

by , on August 23rd, 2017

Posted In: Java Core, String

How to convert a String to an int in Java

Techniques used 1. Using Integer Class 2. Using BigInteger Class 3. Apache Commons IOUtils 4. Guava library  

Read More

by , on August 22nd, 2017

Posted In: IO, Java Core

How to create a Java List from the contents of a file

Techniques used 1. Before JDK 7 using BufferedReader 2. Using JDK 7 Files 3. Apache Commons IOUtils 4. Guava library  

Read More

by , on August 22nd, 2017

Posted In: IO, Java Core

How to create a Java string from the contents of a file

Techniques used 1. Before JDK 7 using BufferedReader 2. Using JDK 7 Files 3. Apache Commons IOUtils 4. Guava library  

Read More

by , on August 22nd, 2017

Posted In: Java Core, String

How do I compare strings in enterprise java application

This is one of the highest viewed question on Stack Overflow (String compare) Though question is more related to ‘==’ vs equals there are more things developer should do while comparing Strings. Null check Most of the Null pointer exception in an application may be caused due to following kind of code To avoid this […]

Read More

by , on August 22nd, 2017

Posted In: Testing

TestNG eclipse plugin

   

Read More

by , on August 21st, 2017

Posted In: Database, MySQL

MySQL table names are case sensitive

I have own product called www.labworkflows.com. After moving application from my Windows local environment to Linux CentOS server I observed lot of my queries stopped working. e.g. select * from LABTESTS works on Windows default MySQL installation but dis not work on CentOS. After digging more into it observed that scripts that I generated through […]

Read More

by , on August 21st, 2017

  • Categories