Sociology, asked by sharmiahmed4, 4 months ago

II. Write TRUE or FALSE:
1. Scanner class is a useful package of JDK 1.5.
2. Strings can even be input without using scanner object.
3. The word 'new' is a keyword to create any object.
4. You need not be aware about the number of tokens to be
input to a scanner object.
5. You can terminate a string even by using carriage return.
6. nextFloat() can also accept an integer token.
7. hasnextInt() results in true if the next token can be interpreted
as an integer​

Answers

Answered by ashwaneebagh
1

Ela na manhe kpd kebb kwq

Answered by Anonymous
89

Answer:

1) True

Explanation:

Java development kit (JDK) 1.5 has a library called JCL ( Java class library). It contains various package. It has special class to input from console called scanner class, which is a useful package of JDK

  • Apackage is a collection of classes such that each class includes different inbuilt functions.

2) True

Explanation:

➤ It is not compulsory to use scanner object while inputting string, so we can input string without using scanner object.

3) True

Explanation:

➤ New is used for dynamic allocation of the object, that is it allots space in a dynamic memory for storage of an object.

4) True

Explanation:

➤ We need not to be aware about the number of tokens to be input to a scanner object.

  • Tokens is defined as each individual component of Java program that carries some meaning and takes active part in program execution.

5) True

Explanation:

➤ Yes, we can terminate a string even by using carriage return. 'Carriage return' \r is a escape sequence which replaces same number of old characters to new characters.

6) True

Explanation:

➤ nextFloat() can also accept an integer ( whole numbers ) token

Functions to enter data

  • float f = sc.nextFloat( );

7) True

Explanation:

➤ If the next token can be interpreted as an integer i.e, whole number, hasnextInt( ) results in true.

▭▬▭▬▭▬▭▬▭▬▭▬▭▬▭▬

Similar questions