3 Topics

Member Avatar for
Member Avatar for rahul.ch

StringBuffer sb = new StringBuffer(new String("Hello")); //Case 1 StringBuffer sb1; //Case 2 String s = new String("Hello"); // Case 2 sb1=s; //Case 2 StringBuffer sb3; //Case 3 sb3 = new String("Hello");//Case 3 Case 1 compiles fine and outputs *Hello* but Case 2 and Case 3 gives compiler error saying incompatible …

Member Avatar for rahul.ch
0
195
Member Avatar for rahul.ch

I noticed that when equals() is used to compare between two String objects it works fine. But when I compare two StringBuffer objects or two StringBuilder objects or mix of String and Builder and Buffer, equals() doesn't work even though I give same string value to the two objects being …

Member Avatar for rahul.ch
0
318
Member Avatar for Hakoo

Hello all, I am retrieving data from servlet to midlet. Now coming data is whole string. but now I want to chop it into different words. here my code is : [CODE] HttpConnection conn = (HttpConnection) Connector.open(url); StringBuffer sb = new StringBuffer(); conn.setRequestMethod(HttpConnection.GET); conn.setRequestProperty("Content-Type", "Application/x-urlformencoded"); InputStream is = conn.openInputStream(); byte[] …

Member Avatar for Hakoo
0
597

The End.