daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest May 16th, 2018 78 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. import java.util.Scanner;
  2.  
  3. public class LengthOfName {
  4.     public static void main(String[] args) {
  5.         Scanner reader = new Scanner(System.in);
  6.  
  7.         System.out.print("Type your name: ");
  8.         String text = reader.nextLine();
  9.         System.out.println("Number of characters: " + calculateCharacters(text));
  10.     }
  11.    
  12.     // do here the method
  13.     public static int calculateCharacters(String text){
  14.  
  15.         return text.length(text);
  16.     }
  17.    
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top