Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. package com.russit99;
  2.  
  3. import java.util.Scanner;
  4.  
  5. /**
  6.  *
  7.  * @author RussIT99 (russkey@gmail.com)
  8.  *
  9.  */
  10. public class project {
  11.    
  12.     /**
  13.      * @param args command line arguments
  14.      */
  15.     @SuppressWarnings("resource")
  16.     public static void main(String[] args){
  17.         /*
  18.         System.out.println("hello World!");
  19.         if(args[0].equals("dog")) {
  20.             System.out.println("Woof");
  21.         }
  22.         int number = 9001;
  23.         if(number > 5) {
  24.             number = number+5;
  25.             System.out.println(number);
  26.         }
  27.         */
  28.         System.out.println("Insert password; ");
  29.         while(true) {
  30.         Scanner myScanner = new Scanner(System.in);
  31.         if(myScanner.nextLine().equals("password")) {
  32.             System.out.println("password correct.");
  33.             break;
  34.         } else {
  35.             System.out.println("password incorect, try again");
  36.         }
  37.     }
  38.         System.out.println("Microserfs- a book by Douglas Coupland");
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement