Page 55 - CA_Blue( J )_Class10
P. 55

D.  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): ASCII stands for American Standard Code for Information Interchange and is a character encoding standard for text
                       files in computers.
                        Reason (R): It is made of 512 symbols and consists all letters used in all vernacular languages.
                    2.  Assertion (A): The escape sequence '\t' in Java is used to represent a horizontal tab.
                        Reason (R): When the '\n' escape sequence is encountered within a string literal, it instructs the compiler to insert a newline
                       character at that position. This causes the subsequent characters to be printed on a new line in the output.


                                             Previous Years' Questions


                    1.  Identify the type of operator &&:                                                           [2023]
                       a.  ternary                                     b.  unary
                       c.  logical                                     d.  relational
                   Ans.  c.
                    2.  A data type which contains integer as well as fractional part and occupies 32 bits space is:   [2022]
                       a.  float                                       b.  char
                       c.  double                                      d.  byte
                   Ans.  a.
                    3.  Which of the following keyword is used to create symbolic constants in Java?                [2022]
                       a.  final                                       b.  Final
                       c.  Constant                                    d.  Const
                   Ans.  a.
                    4.  State whether the statement is True or False:                                               [2022]
                        char is a non - primitive data type.
                       a.  True                                        b.  False
                   Ans.  b.
                    5.  Give the output of the following:                                                           [2022]
                       int x=2, y=4, z= 1;
                       int result = (++z)+y+(++x)+(z++);
                       a.  11                                          b.  12
                       c.  10                                          d.  9
                   Ans.  a.
                    6.  Write the memory capacity (storage size) of short and float data types in bytes.            [2019]
                   Ans.  The memory capacity of short is 2 bytes and float 4 bytes.
                    7.  Identify and name the following tokens:
                       a.  public                                      b.  'a'
                       c.  ==                                          d.  {}                                       [2019]
                   Ans.  a.  public   :  Keyword                       b.  'a'        :  Character Literal
                       c.  ==         :  Operator                      d.  {}         :  Punctuator
                    8.  State the data type and value of res after the following is executed:
                       char ch = '9';
                       res = Character.isDigit(ch);                                                                 [2019]
                   Ans.  The data type is boolean and the value of res is true.


                                                                                                                       53
                                                                                                 Values and Data Types  53
   50   51   52   53   54   55   56   57   58   59   60