Kode Log

Change is now. Learn, unlearn & relearn.

Page 6 of 11

Item 10: Always override toString

Providing a good toString makes your class pleasant to use. Not only the users of your class will love using the toString method, even the debuggers IDEs use the toString method of your object. e.g. Which would you rather see… Continue Reading →

A good bird’s view of java exceptions and errors.

Item 7: Avoid finalizers

There is no guarantee that the finalize method will be called immediately. So, one should not depend upon it for anything time critical. The Great Ancient Myth System.gc and System.runFinalization call finalizers with guarantee. The Truth They even don’t guarantee… Continue Reading →

Item 6: Eliminate obsolete object references

Please take a minute to go through the code given below. /** * Example of a memory leak * * @author lekhak.tumblr.com */ public class Stack { private Object[] elements; private int size = 0; private static final int DEFAULT_INITIAL_CAPACITY… Continue Reading →

Varargs in main method

While going through some of the examples on the internet on “varargs”(variable arguements) feature introduced in Java 1.5, I noticed a strange fact.  No one uses varargs in main method. I fail to think of a reason why. In case… Continue Reading →

Zero Day Bug

The 0 day bugs with description.

Zero Day Bug

The 0 day bugs with description. Zero Day Bug

Oracle. What have you done to my java?

The zero day flaw have hit java right in its face. Apparently the java apllets can be tricked into invoking *.exe files unless the file is sufficiently secure. Oooh oracle!!! What have you done to Java. Only Java7 is vulnerable… Continue Reading →

Item 5: Avoid creating unnecessary objects

Avoid creating unnecessary objects This post will be bulleted as it shares more than one instance to take care of. new String(“SomeString”) This is a crime, the reason being Strings in java are immutable objects. “SomeString” string is an object… Continue Reading →

« Older posts Newer posts »

© 2017 Kode Log — Powered by WordPress

Theme by Anders NorenUp ↑