package nameyu;import java.util.Scanner;public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); System.out.print("Enter a string:"); String numbers=input.nextLine(); int l=numbers.length(); char ch=numbers.charAt(0); System.out.println("length :"+l); System.out.println("first character :"+ch); } }
|