Conditional Statements in Java


Available Answers

  1. 1.

    What is the use of the keyword import?

  2. 2.

    Name the type of error (syntax, runtime or logical error) in each case given below:

    1. Division by a variable that contains a value zero.
    2. Multiplication operator used when the operation should be division.
    3. Missing semicolon.
  3. 3.

    Complete the code below to create an object of scanner class.

    Scanner sc = ______ Scanner (................)

  4. 4.

    Name the method of Scanner class that:

    1. Is used to input an integer data from the standard input device.
    2. Is used to input a string data from the standard input device.
  5. 5.

    Write down the syntax with reference to Java Programming:

    1. to accept an integral value from the user from console
    2. to accept a fractional number from the user from console
    3. if - else statement
    4. switch case
  6. 6.

    Differentiate between if and switch statement.

43 more answer(s) available.

Please login to post your comments.