3:53 pm - Friday March 24, 5916

StringBuilder Example Program for charAt(int index)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
@Author :candidjava.com
@Description:  Returns the char value in this sequence at the specified index.
*/
import java.io.*;
import java.lang.*;
import java.io.IOException;
public class StringBuilder1
{
public static void main(String args[])throws IOException
{
String s="welcome";
char c;
StringBuilder sb=new StringBuilder(s); //object creation of string builder
c=sb.charAt(5);//returns the char which placed aftr 5th position
System.out.println(c);
}
}

Output
m

BACK

Filed in: Z-A All Java Codes

Comments are closed.