Monday, 28 December 2015

StringBuilder

StringBuilder StringBuilder class is used to create mutable(modifiable) string. The java Stringbuilder calss is same as Stringbuffer. StringBuilder is a non-synchronized. Its is available since JDK 1.5. Important constructors of StringBuilder Class: StringBuilder(): creates an empty string Builder with the initial capacity of 16. StringBuilder(String str): creates a string Builder with the specified string.    3.StringBuilder(int length): creates an empty string Builder with the     specified capacity...

Monday, 21 December 2015

StringBuffer

Java StringBuffer class    Java StringBuffer class is used to created mutable (modifiable) string. The StringBuffer class in java is same as String class except it is mutable i.e. it can be changed. Note: Java StringBuffer class is thread-safe i.e. multiple threads cannot access it simultaneously. So it is safe and will result in an order. Important methods of StringBuffer class: public synchronized StringBuffer append(String s): is used to append the specified string with this string. The append() method is overloaded like...

Thursday, 17 December 2015

Android - JSON Parser

JSON Parser JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML.  This chapter explains how to parse the JSON file and extract necessary information from it. Android provides four different classes to manipulate JSON data.  These classes are JSONArray,JSONObject,JSONStringer and JSONTokenizer. The first step is to identify the fields in the JSON data . In the JSON given below.  For example:  http://demo.codeofaninja.com/tutorials/json-example-with-php/index.php...