Tag Archives: string

Difference between String and StringBuffer’s equals method

This is one of the tricky questions that you may come across while facing java interview. Let me help you getting this through. The interviewer will give you two liners and ask you what its will return. Lets make it simpler for us to understand this, we will consider the following example.

Convert String to XML file in Java.

Hello Friends,

In the previous example we have seen how to convert XMl to String. Now this example will do the exact opposite of the previous one i.e. we will now try to convert the String stream into an XML file object. Here is the simple code for that.

Convert XML file to String Object in Java.

Hello Friends,

This is one of my tutorials in java with respect to XML. Sometimes while working with web-services we may come accross with the requirements of sending the updates to the web-service via a XML file. For the same you may need to convert the XML file into a stream of String (however we can pass XML file to web-services for updation). But, at some times if you need to update the values or attributes of the XML and then send it as s String then following code will do it for you.