Java String



  1. public boolean equals(object obj) :- Compare the values of Strings (Case Sensitive ).
  2. public boolean equalsIgnoreCase(oblect/String) : - Compare the values but ignore the case .
  3. public String concat(String str) :- Concatenate the Specified string to the end of this string .
  4. public int compareTo(String str) :-Compare two Strings and return int.if first have more length return 1 .for less -1 and for equals return 0  (Case Sensitive).
  5. public int compareToIgnoreCase(String str) :- Just Ignore the Case .
  6. public String subString(int beginIndex) :- returns a new String .
  7. public String subString(int beginindex, int endIndex) .
  8. public String toUpperCase() :- Convert Full string to upper case .
  9. public String toLowerCase() :- Convert Full String to Lower Case .
  10. public String trim() :- Return a copy of the String with leading and trailling whitespace omitted .
  11. public boolean startsWith(String Prefix) : Tests if this String starts with the specified prefix .
  12. public boolean endsWith(String suffix) : - Tests if this String ends with the specified suffix .
  13. public char charAt(int index) :- returns the char value of specified index .
  14. public int length() :
  15. public String intern() : - Returns a conical representation for string object . 
  16. Once String object has been created , It's value can't be changed  . it is immutable property of string object in java .
  17. If one reference variable changes the value of the object , it will be affected to all the reference variables . that's why string objects are immutable in java .


No comments:

Post a Comment

Optimize your Programming Skills

  Java is The most Powerful Programming Language , Because of it's Oops Concept and it's Compilation Process . After The Compilatio...