HI EVERYBODY This is nivvi, i am new to this. I have doubt regarding strings and stringbuffers.can i use srtingbuffers instead of strings?if so, then which performance is better ?i mean working with strings is better one or stringbuffer is better one for increasing the performance of the progam.
As others have said already, String and StringBuffer are quite different, so there are not all that many situations where you could actually swap one for the other.
Note, though, that StringBuffer is mostly superceded by StringBuilder, in Java 5 onwards. You should not use StringBuffer in new code, but instead should use StringBuilder.
The reason for preferring StringBuilder is that it is not encumbered with pointless synchronisation. Very few uses of StringBuffer actually made use of its synchronisation, but all suffered the performance costs of it.
As a beginner, you don't really need to understand the paragraph above. Just remember that, if you are writing for Java 5 or newer, use StringBuilder.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.