Page 54 - CA_Blue( J )_Class10
P. 54

Unsolved Questions



              A.  Tick ( ) the correct answers.
                  1.  To store character values, a corresponding numeric value is generated in ………………….
                    a.  Decimal form                                b.  Binary form
                    c.  ASCII                                       d.  Unicode
                  2.  Which of the following is the correct way to declare a constant variable in Java?
                    a.  const int MAX_VALUE = 100;                  b.  final int MAX_VALUE = 100;
                    c.  static int MAX_VALUE = 100;                 d.  constant int MAX_VALUE = 100;
                  3.  Which escape sequence is used to represent a tab in a string?
                    a.  \n                                          b.  \\
                    c.  \t                                          d.  \'
                  4.  Which of the following is an example of a reference data type?
                    a.  int                                         b.  array
                    c.  float                                       d.  double
                  5.  Which of the following can be used while creating an identifier?
                    a.  Letters                                     b.  Underscore (_)
                    c.  Dollar ($)                                  d.  All of these
                  6.  Which of the following escape sequences is used to insert a backslash character (\) inside a string in Java?
                    a.  \n                                          b.  \\
                    c.   "                                          d.  \b
                  7.  Which of the following is true about primitive data types in Java?
                    a.  They are objects.                           b.  They have methods.
                    c.  They are defined by classes.                d.  They are directly stored in memory.
                  8.  Which of the following statements correctly initializes a String variable?
                    a.  String str = 'Hello';                       b.  String str = Hello;
                    c.  String str = "Hello";                       d.  String str = new String(Hello);
                  9.  Which of the following is required for an explicit type conversion?
                    a.  Assignment operator                         b.  Type casting
                    c.  Relational operator                         d.  Logical operator
                 10.  Which of the following is NOT a valid explicit type conversion in Java?
                    a.  float f = (float) 10.5;                     b.  int i = (int) 10.5;
                    c.  boolean b = (boolean) 1;                    d.  byte b = (byte) 100;

              B.  Fill in the blanks.

                  1.  Character set in Java consists of letters, digits and ………………… characters.
                  2.  Implicit type conversion takes place when the two types are ………………….
                  3.  Non-primitive data types are also called ………………… data types.
                  4.  The size of the "short" data type is ………………… than the "long" data type.
                  5.  The ………………… a special Java literal which represents a null value.

              C.  Answer the following questions:
                  1.  Define String literals and boolean literals.
                  2.  Write the difference between declaration and initialization.
                  3.  Name the various types of tokens used in Java.
                  4.  Explain the difference between primitive and non-primitive data types in Java.
                  5.  What is the difference between variables and identifiers?





                5252  Touchpad Computer Applications-X
   49   50   51   52   53   54   55   56   57   58   59