0% found this document useful (0 votes)
2 views9 pages

Core Java String Basics and Methods

The document provides an overview of the String class in Java, highlighting its characteristics as an immutable data type used to store character sequences. It lists various methods associated with String, such as charAt(), length(), and substring(), which perform operations on string data. Additionally, it emphasizes that all classes in Java can be used as reference data types.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

Core Java String Basics and Methods

The document provides an overview of the String class in Java, highlighting its characteristics as an immutable data type used to store character sequences. It lists various methods associated with String, such as charAt(), length(), and substring(), which perform operations on string data. Additionally, it emphasizes that all classes in Java can be used as reference data types.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Core Java - Strings

What is String ?

• String is a pre-defined class available in [Link] package

• String we can use as a data type also (Referenced Data Type)

Note : Every class in the java can be used as a referenced data type

• String is used to store group of charaters {Char Sequence}

• String is Immutable - String objects cant be modified

2
Why String Immutable?

String objects cannot be


modified
String Interface
Implementation
String Literal Architecture
String New Architecture
String Methods
• charAt() ---> Returns the character value of the particular index
• length() ---> Returns the total length of the char sequence
• equals() ---> Checks the equality of the String with given object
• equalsIgnoreCase() ---> Checks the equality of the String with given object and ignores
the case sensitivity
• isEmpty() ---> Checks the given String is empty or not
• substring() ---> To take a particular portion of a String
• substring() ---> To take a particular portion of a String from begin index to end index
• concat() ---> To appends the String to the given string

7
String Methods
• replace() ---> To replace the existing char with the given char (Group of Chars also
can be replaced)
• indexof() ---> Returns the index value for the char in the string
• trim() ---> Removes the space from start and end of the string
• [Link]() ---> Coverts the int to string
• toLowerCase() ---> Converts from upper to lower case
• toUpperCase() ---> Coverts from lower to upper case
• [Link]() ---> Returns a joined string with delimiter
• split() ---> Splits the given string with delimiter or group of chars

8
thank you
JAYACHANDRAN
9444624939

You might also like