Вы находитесь на странице: 1из 6

Contribute Us | Ask Question | login

JavaTpoint
Home

Core Java

Subscribe Us
91-9990449935
0120-4256464

Search on javatpoint...

Servlet

Basics of Java

JSP

EJB

Struts2

Mail

Hibernate

Spring

Android

Design P

Quiz

Projects

OOPs Concepts

Java String charAt

Java String

The java string charAt() method returns a char value at the given index

What is String

number. The index number starts from 0.

prev

next

Immutable String
String Comparison

Signature

String Concatenation
Substring
Methods of String class
StringBuffer class

1.

StringBuilder class

The signature of string charAt() method is given below:


public char charAt(int index)

String vs StringBuffer
StringBuffer vs Builder

Parameter

Creating Immutable class


toString method

index : index number, starts with 0

StringTokenizer class
String Handling quiz-1

Java String Methods


open in browser PRO version

Returns

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

String charAt()

char value

String compareTo()
String concat()

Specified by

String contains()
String endsWith()

CharSequence interface

String equals()
String format()
String getBytes()

Throws

String indexOf()
String intern()

IndexOutOfBoundsException : if index is negative value or greater than

String isEmpty()

this string length.

String join()
String lastIndexOf()

Java String charAt() method example

String length()
String replace()
String replaceAll()

1.

public class CharAtExample{

String split()

2.

public static void main(String args[]){

String startsWith()

3.

String name="javatpoint";

String substring()

4.

char ch=name.charAt(4);//returns the char value at the 4th index

String toCharArray()

5.

System.out.println(ch);

6.

}}

String toLowerCase()
String toUpperCase()

Test it Now

String trim()
String valueOf()
open in browser PRO version

t
Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Java Regex
Exception Handling

Next Topic

Java String compareTo

Java Inner classes


Java Multithreading
Java I/O

prev

next

Java Networking
Java AWT
Java Swing
Java Applet
Java Reflection
Java Date
Java Conversion
Java Collection
Java JDBC
Java New Features
RMI
Internationalization
Interview Questions

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Top

Like/Subscribe us for latest updates or newsletter


Tutorials

Interview Questions

Quizzes

Forum

Core Java Tutorial

Java Interview

Core Java quiz

Core Java Ques.

Servlet Tutorial

Servlet Interview

Servlet quiz

Servlet Ques.

JSP Tutorial

JSP Interview

JSP quiz

JSP Ques.

Mail API Tutorial

Hibernate Interview

Struts2 quiz

Struts Ques.

Design Pattern Tutorial

Spring Interview

Android quiz

Spring Ques.

Struts Tutorial

Android Interview

OCJP quiz

Hibernate Ques.

Spring Tutorial

SQL Interview

OCWCD quiz

Android Ques.

Hibernate Tutorial

PL/SQL Interview

Hibernate quiz

Android Tutorial

Oracle Interview

Spring quiz

JavaScript Tutorial

MySQL Interview

C quiz

SQL Tutorial

SQL Server Interview

Cloud Computing quiz

C Tutorial

MongoDB Interview

JavaScript quiz

AJAX Tutorial

Cloud Interview

SQL quiz

JUnit Tutorial

Projects
SSS IT PVT LTD
Development
Training
SEO

JAXB Tutorial

Consultancy

Maven Tutorial

CONTACT US
Tel. : 0120-4256464
M ob. : +91 9990449935
Email : enquiry@sssit.org
Address: 2nd Floor, G-13,

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

(Near 16 M etro Station),


Sec - 3, Noida,
201301, UP, India

Contact Us
Privacy Policy

2011-2014 Javatpoint.
All Rights Reserved.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Вам также может понравиться