Problem with first java project with Whilebreakwithloop

时间:2019-05-19 03:52:27

标签: java

Write a simple program that uses a break statement to end the while loop where the condition in while loop is always true. Test the user input and if it is zero then use a break to exit or come out of the loop.

Do I need to add any value to execute the code?

import java.util.Scanner;
class WhileLoopWithBreak {
    public static void main(String[] args) {
        int n;
        Scanner input = new Scanner(System.in);
        while () {
            continue;
        } else {
            break;
        }
    }
}

1 个答案:

答案 0 :(得分:0)

检查:

handleResponse(data){
  if(this.user.user_id == 1){
     this.router.navigateByUrl('/admindashboard');
  }
  else
  {
     this.router.navigateByUrl('/userdashboard');
  }
}