/Java-way-of-life

its just a start.....drops and drops make a sea....

Java-way-of-life

hello-world

its just a start.....drops and drops make a sea.... I am Anshul Shrivastava.I am an Indian and lives in Bhopal.

System.out.println("Hello World !");

String Class

  • Immutable
  • Have 11 different constructors so can take initial value using different sources.

accessing methods :

  • string.length() : returns number of characters contained in the string object.
  • string1.Concat(string2) : concatenates two strings.
  • String fs = String.format(“%s %d %f”,string1,int1,float1).
  • fs.charAt(index) :returns char at given index.
  • Int compareTo(object o) : This method compares this String to another Object lexicographically.
  • Int compareToIgnoreCase(String str) : This method compares this String to another Object lexicographically ignoring case differences.
  • boolean contentEquals(StringBuffer sb) : This method returns true if and only if this String represents the same sequence of characters as specified in StringBuffer.