Java single output character string and its length is obtained

SC = new new Scanner Scanner (the System.in);
String sc.nextLine S = (); // Scanner class does not provide a direct method for receiving a character, this character string as received;
char s.charAt = C (0) ; // call charAt string () method to get the first character wants
int n = s.length (); // get the length of the string s

Published 254 original articles · won praise 23 · views 50000 +

Guess you like

Origin blog.csdn.net/qq_30242987/article/details/104694419