daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Scanner in = new Scanner(System.in);
  2. String name;
  3. String surname;
  4. String middleName;
  5. String address;
  6. String joinDate;
  7.  
  8. System.out.print("Add new employeenEnter employee name: ");
  9. name = in.next();
  10.  
  11. System.out.print("Enter employee surname: ");
  12. surname = in.next();
  13.  
  14.  System.out.print("Enter employee middle name: ");
  15.  middleName = in.next();
  16.  System.out.print("Enter employee address: ");
  17.  address = in.next();
  18.    
  19. if (in.hasNextLine()) {
  20.     middleName = in.next();
  21. } else {
  22.     middleName = null;
  23. }
  24.    
  25. import java.io.BufferedReader;
  26. import java.io.IOException;
  27. import java.io.InputStreamReader;
  28.  
  29. public class Main
  30. {
  31.     public static void main(final String[] args) throws IOException
  32.     {
  33.         final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
  34.         System.out.print("Enter employee middle name: ");
  35.         final String middleName = reader.readLine();
  36.         System.out.println("middleName = '" + middleName + "'");
  37.     }
  38. }
  39.    
  40. import java.io.IOException;
  41. import java.util.Scanner;
  42.  
  43. public class Main
  44. {
  45.     public static void main(final String[] args) throws IOException
  46.     {
  47.         final Scanner in = new Scanner(System.in);
  48.         System.out.print("Enter employee middle name: ");
  49.         final String middleName = in.nextLine();
  50.         System.out.println("middleName = '" + middleName + "'");
  51.     }
  52. }
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