Skip to main content

Posts

Showing posts from December, 2012

Useful Java Best Practices Short and Sweet

1. Avoid creating unnecessary objects. Object creation is the more expensive operation in java.So, Create an objects when its required, public class Student {     private List students;     public List getStudents() {         if(students == null) {             students = new ArrayList();         }         return students;     } }