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

length() Method In Java

                         

In this section, you will learn how to use length() method of the String class. We are going to using length() method. These method are illustration as follow here:

Description of program:

Here, we will know that how many character of length in String. First of all, we have to define class named "StringLength". Inside of class we have to define method of class in  main class. After that we create one method which returns the integer type values. So we are using to length() method of the String class for the purpose.

length() method : This method return the length of this string as an integer value.

Here is the the code of this program:

import java.io.*;

class StringLength{
  public static void main(String[] args){
    try{
      BufferedReader object=new BufferedReader (new InputStreamReader(System.in));
      System.out.println("Eneter string value:");
      String s=object.readLine();
      int len=s.length();
      System.out.println(len);
    }
    catch(Exception e){}
  }
}

Output this program:

C:\java_work>javac StringLength.java

C:\java_work>java StringLength
Eneter string value:
amar
4
C:\java_work>

Download this program:

                         

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:
why struts 1.1
coding
increase size of strut
ga me s
java program for permu
retereive an image fro
decimal to ANSI
Integer.ParseInt java
xform example
define functions in js
how to pass same varia
Integer.ParseInt examp
first application of s
Mylyn
Quick Sort
working with combobox
passing images to jsp
factory
breakะ????ะ???ะ?
HTML table in java
simple appet
reads data into text f
Changelanguageaccordin
url rewriting
getter setter methods
DynaAction Form
LSB of String java
jasper reports using j
Create Scroll Bar in J
struts2 tag
array element
struts2 tag library
integer.parseInt
what is rfc
threads\
example for org.jfree.
jboss 4.2.1.GA
Flex TreeGrid
java program to find s
Date Examples java
binary to hexadecimal
myfaces tomahawk
sqlserver2000
Installing Sun JDK on
what is rfc ?
struts 1 date picker e
midlet inbox example
modity data in text fi
in mysql how to store
Photoshop Drawing Cart
JDBC with Mysql in Ecl
form bean
collections interview
web.xml file
Matrix Example in Java
breakั?�??????ั?
program to find greate
WHERE Statement in SQL
mdb
create a tree to be di
java cancel button
find out factors of nu
passing value from ser
Struts1.1 example down
bubble sort
rfc
JSP in error page
Display image on JSP p
JScrollPane
Date
how to get the time di
DB2
download package com.s
log4j/
java program to check
conversion of decimal
array java
api struts
linked list and GUI
Designing Star sign sy
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.