daily pastebin goal
23%
SHARE
TWEET

Untitled

a guest Apr 21st, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class SingletonTest {
  2.   public static void main(String[] args) {
  3.     Scanner input = new Scanner(System.in);
  4.     if(CurrentUser.isLoggedIn()) {
  5.       System.out.println("User "
  6.           + CurrentUser.user().getUsername()
  7.           + "telah login");
  8.     } else {
  9.       System.out.println("Belum ada user yang login");
  10.       System.out.println("Masukkan username: ");
  11.       String username = input.nextLine();
  12.       System.out.println("Masukkan password: ");
  13.       String password = input.nextLine();
  14.       CurrentUser.login(username, password);
  15.     }
  16.     System.out.println("\nUser yang telah login:");
  17.     System.out.println("Username: " + CurrentUser.user().getUsername());
  18.     System.out.println("Password: " + CurrentUser.user().getPassword());
  19.     System.out.println("\nUser akan logout...");
  20.     CurrentUser.logout();
  21.     System.out.println("User telah logout!");
  22.     if(CurrentUser.isLoggedIn()) {
  23.       System.out.println("Masih ada user yang login");
  24.     } else {
  25.       System.out.println("Tidak ada user yang login");
  26.     }
  27.   }
  28. }
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