Solutions for Class 10 ICSE Logix Kips Computer Applications with BlueJ Java | IT Developer <?php echo $page_title; ?>
IT Developer

Input in Java

Chapter 6

Input in Java

Class 10 - Logix Kips ICSE Computer Applications with BlueJ


Share with a Friend

Multiple Choice Questions


Question 1

A programmer wrote the following statement:
    netPay = grossPay + providentFund;
instead of:
    netPay = grossPay - providentFund;
Assuming all the unseen code is correct, what kind of error is it?

  1. Syntax error
  2. Runtime error
  3. Logical error
  4. None of these

Question 2

Which of the following might make the Java compiler report a syntax error in a particular line of a program?

  1. The program is typed in the wrong font.
  2. The line contains a comma (,) instead of a dot (.).
  3. It is caused by Java runtime.
  4. Program takes too long to compile.

Question 3

Which of the following statement is true for logical errors?

  1. The compiler does not detect these errors.
  2. There is no indication of error when the program is executed.
  3. The program may produce correct results for some input data and wrong results for other input data.
  4. All of the above

Question 4

Which keyword do you use to include a class in your program?

  1. import
  2. export
  3. include
  4. impart

Question 5

Which of the following is not a valid method of the Scanner class?

  1. next()
  2. nextInt()
  3. nextLong()
  4. nextNumber()

Question 6

Default delimiter used in the Scanner class is ...........

  1. Comma
  2. Whitespace
  3. Colon
  4. There is no default delimiter.

Question 7

Which package would you import to display the date and time?

  1. java.util.*
  2. java.Date.*
  3. java.io.*
  4. java.lang.*

Question 8

Which package would you import for the Scanner class?

  1. java.util.*
  2. java.awt.*
  3. java.io.*
  4. java.lang.*

Question 9

Errors occur in a program when ...........

  1. Syntax of the programming language is not followed.
  2. The program does not run properly or does not execute at all.
  3. The program produces an incorrect result.
  4. All of the above

Question 10

The Scanner class can be used to read input from ...........

  1. a keyboard
  2. a file
  3. a string
  4. All of these