I keep getting a Null pointer exception for the StingBuffer .
Below is the sample code ..
StringBuffer buff = new StingBuffer(“dummy”+”dummy2”
+”dummy3”);
I get an null pointer at the first line where buff is initialized .
So I changed this to
StringBuffer buff = new StringBuffer();
buff.append(“dummy”
+”dummy1”
+”dummy2”);
Now I get the null pointer exception at buff.append line. Which is right after its initialization and it is very strange.
I am going crazy as to why I am getting a null pointer exception when I have actually initialized it .
Can anyone advice on this !!!