Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

charAt() Method In Java

                         

In this section, you will get the detailed explanation about the charAt() method of String class. We are going for using charAt() method. You can see how to use the method by syntax. There is a section provided for understanding the usage of the method practically.

Description of program:

Here, you will understand about the procedure of the charAt() method through the following java program. This program reads a string as input through the keyboard. And first this shows the length of the string then find the character at the 4th (mentioned as a parameter of the method) position of the string that is retrieved by using charAt() method. This method takes a parameter that is the position of the string. The charAt() method returns a character value for the character at the given position of the string.

Here is the code of this program:

import java.io.*;
class CharAt{
  public static void main(String[] args){
    try{
    BufferedReader object=new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter the String");
    String s=object.readLine();
    int len=s.length();
    System.out.println(len);
    char char1=s.charAt(4);
    System.out.println(char1);
    }
    catch(Exception e){}
  }
}

Output this program:

C:\java_work>java CharAt
Enter the String
roseindia
9
i
C:\java_work>

Download this example.

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
java program to find s
get column name and va
textbox character vali
java.policy
JScrollPane
reads data into text f
jsp and servlets examp
Photoshop Effects Hole
excel style sheet
insert data in Jtable
cactus
Selection Sort In Java
GUI Tutorial I - FIRST
java date compare exam
Javascript Date and Ti
permutation combinati
struts.mapper.class
Count Records using th
ArrayList
get column count
form bean
read odd rows in excel
parent child listbox
xsd
create file menu using
axis 2
toplink
JGRAPH
ASP.NET .NET Sending M
jsp mysql combo box
Get Array List in a JS
Java Validations java
jdbctemplate.execute
create excel using jav
JDOM Introduction
get column count +colu
jsp images
drop down in jsp
Flash Tutorial : Parti
fileupload jsf
write to text file lin
add time
flex struts
Applet event button
write to text file
onglet + css
split
.dat file update
Java Mysql
insert calendar in jsp
do while in java
mysql to JTable
calling one jsp p
Why Virtual Dedicated
session
C : A Dialog: Program
JavaFX Mobile
Converting an Array to
sample notepad source
default constructor
Photoshop Effects Imag
for each in java
jdbc sample
validator
all ejb program
Photoshop Animation Ba
Object-Oriented
hibernate3.0 jar file
ejb 2 tutorial
strut 2 upload
write a xml file using
Features of jsp2.1
config.xml
Chat Server using php
build.xml
jsp Insert data in mys
GWT DateTimeFormat exa
File Java
To display text as an
sea
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.