Could someone please explain how to make the input end when I press . without having to press enter and calculate the length without too much advanced stuff since I am just a beginner.
class UserInput//defines class
{//class begins
public static void main (String[] args) throws IOException
{//main method begins
BufferedReader bf = new BufferedReader(newInputStreamReader(System.in));
//tells the user what the program does
System.out.println("This program will give you the total number of inputed characters.");
// tells the user how to end the program
System.out.println("To obtain your final number of characters, enter .");
System.out.println("");
//tells user to type in characters
System.out.println("Enter any characters you want:");
String input = bf.readLine(); //reads the user input and initializes input
//initialize and declares variables
int length = 0;
length = length + anything.length();
//outputs total number of characters
System.out.println("The total number of characters input is " + length);
}//main method ends
}//class ends