Write a String length() program

Write a String length() program

Program
import java.util.Scanner;
public class Main
{
    public static void main(String args[])
    {
        String s;
        int n;
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter String : ");
        s=sc.nextLine();
        n=s.length();
        System.out.print(n);
    }
}


Output:

Enter String : Sateesh
7


Strings Handling In Java



More Questions


173 . Write a String length program
174 . Write a string charAt() method program
175 . Write a string toLowerCase() Program
176 . Write a String toUpperCase() program
177 . Write a string concat() program
178 . Write a string compareTo program
179 . Write a string compareToIgnoreCase() Program
180 . Write a string equals program
181 . Write a string equalsIgnoreCase() program
182 . Write a string startsWith() program
183 . Write a string endsWith() program