A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

Some other important methods are:

Some other important methods are:

Some other very important methods in String class in java: setLenth(),length(), append(String), charAt() and setCharAt()

Some other very important methods in String class in java





1. setLenth() syntax:
void setLength();

Example: 
sb.setLength(10);
Sop(sb.length());



2. charAt() and setCharAt() Syntax:

char charAt(int position)
void setCharAt(int position, char ch)
append()

Example:

StringBuffer sb= new StringBuffer(“Heera”);
sb.append(“Babu”);
sop(sb);//Heera Babu


 

LEARN TUTORIALS

.

.