Page 84 - CA_Blue( J )_Class9
P. 84
3. What is the use of “\t” and ‘\n’ in Java?
4. Define Operators. Name the any three types of Operators.
5. Define separators and punctuators.
6. What is the size of the following in terms of bits.
a. short b. double
c. int d. char
7. Define escape sequence. Give two examples.
8. What are the types of casting shown in the following examples?
a. int a=(int)5.6 b. long l= 4
9. Differentiate between primitive and non-primitive data types.
10. What is the meaning of composite data types. Name some composite data types.
21 st
D. Case Study. Century #Experiential Learning
Skills
A non-graphical character which is preceded by a backslash (\) having a special meaning for the compiler is known as
Escape Sequence. Java has total eight escape sequences. They are used to perform a specific task and are valid Character
Literals. They are \t,\b,\n,\r,\f,\’,\” and \\.
1. Escape sequence is ………………….
a. Graphical Character b. Non-Graphical Character
c. ASCII Character d. None of them
2. The output of System.out.println(“He said, \n Where are you going?”);
a. He said, Where are you going? b. He said, Where are you going?
c. Both of them d. A keyword in Java
3. To print “He is a computer student”, we should write.
a. System.out.println(“He is a computer student”);
b. System.out.println(“\“He is a computer student”\”);
c. System.out.println(“\”He is a computer student\””);
d. None of them
4. What is the use of \t?
a. Used to insert a Tab b. Used to insert a backspace
c. Used to insert a newline d. Used to insert a carriage return
5. Identify an escape sequence that is used to insert a double quote character.
a. \” b. \\
c. \r d. \b
E. Assertion and Reasoning based questions.
The following questions consist of two statements – Assertion (A) and Reason (R). Answer these questions by selecting
the appropriate option given below:
a. Both A and R are true, and R is the correct explanation of A.
b. Both A and R are true, but R is not the correct explanation of A.
c. A is true, but R is false.
d. A is false, but R is true.
1. Assertion(A): The literal 10.5F in Java is treated as a float data type.
Reason(R): In Java, floating-point literals are of type float by default.
2. Assertion(A): Implicit type conversion in Java can convert a double to an int without any explicit casting.
Reason(R): Java automatically promotes smaller data types to larger data types during implicit type conversion.
82 Touchpad Computer Applications-IX

