What is a Java string?

 A Java string is a sequence of characters that exists as an object of the class java.lang. Java strings are created and manipulated through the string class. Once created, a string is immutable -- its value cannot be changed.

A string is sequence of characters. A class is a user-defined template for creating an object. A string class is a user-defined template for creating and manipulating string objects, which are sequences of characters.

Methods of class string enable the following capabilities:

  • examining individual characters in the string;
  • comparing strings;
  • searching strings; and
  • copying strings with characters converted from uppercase to lowercase or vice versa.


Comments

Post a Comment

Popular posts from this blog

SimpleExpandableListAdapter in Android with Example