I wrote this code:
import java.util.Scanner;
public static void main (String[] args){
Scanner scan = new Scanner (System.in);
String inp;
int m;
System.out.println ("Please enter some characters.");
inp = scan.nextLine();
m = inp.length();
System.out.println(" = " + m);
}
If I run that, I get something like this:
Please enter some characters.
12345
= 5
But how can I get the = 5
to be printed on the same line as the characters entered by the user, like below?
Please enter some characters.
12345 = 5