Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 27th, 2013  |  syntax: Java  |  size: 0.68 KB  |  views: 38  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2. public class test
  3. {
  4.         public static void updateUserTitle() {
  5.                  
  6.         System.out.printf("\n");
  7.         System.out.println("Please enter a valid user ID: ");
  8.  
  9.         String titleInput = console.nextLine();
  10.         User foundUser = null;
  11.        
  12.         for (int i=0; i <= currentUsers; i++) {
  13.                 if (titleInput == userArray[i].userID)
  14.                 {
  15.                         foundUser = userArray[i];
  16.                 }
  17.                 }
  18.                
  19.                 if(foundUser!=null)
  20.                 {
  21.                         System.out.println("Please enter the new name for the user: ");
  22.  
  23.                          String newName = console.nextLine();
  24.  
  25.                          empArray[i].username = newName;
  26.                 }
  27.                 else
  28.                 {
  29.                         System.out.println("User not found");
  30.                 }
  31.  
  32. }
clone this paste RAW Paste Data