Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

duplicate local variable in java

    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        String input = null;
        do
        {
          System.out.println("Enter 'A' for option A or 'B' for option B.");
          input = sc.nextLine();
          //input.toLowerCase();
          //input.charAt(0);  
        }
        while ((input != "a") || (input != "b"));
    }
 
PREVIOUS NEXT
Tagged: #duplicate #local #variable #java
ADD COMMENT
Topic
Name
7+8 =