Page 139 - Cs_withBlue_J_C11_Flipbook
P. 139

Let’s Revisit



                       ♦ Every individual component used in Java code is known as a Token. It is also known as the building block of Java Programs.
                       ♦ There are six different types of tokens found in Java.
                       ♦ Identifiers are user-defined names required to name a class, variables or a method.

                       ♦ Literals are the values that are required to be stored in variables for further processing. There are many types of literals available
                      in Java.
                       ♦ Punctuators are the special characters that have some special jobs.
                       ♦ Separators are used to separate the variables or characters.
                       ♦ Operators use operands to perform mathematical and non-mathematical operations to give some results.
                       ♦ Escape sequences are the characters preceded by '\' to perform special operations such as inserting a horizontal tab, inserting
                      a new line, etc.
                       ♦ There are two different types of data: primitive and non-primitive.
                       ♦ In Java, there are eight different types of primitive data and four types of non-primitive data.
                       ♦ Arithmetic expressions contain variables, constants and arithmetic operators and are used to do calculations.
                       ♦ There are two different types of expressions: Pure and Mixed.
                       ♦ The process of changing the value of one type to another type is known as type conversion or type casting. There are two
                      different types of conversions: implicit and explicit.
                       ♦ The wrapper class is used to convert the primitive data type to its object and vice versa. Each primitive data type has a wrapper
                      class of its own.






                                                              MIND DRILL





                      Solved Questions



                 A.  Tick ( ) the correct option:
                    1.  In Java, what name is given to every individual component?
                       a.  Token                                       b.  Assignment
                       c.  Operators                                   d.  None of these
                    2.  Which of the following is not a type of token?
                       a.  Identifier                                  b.  Separators
                       c.  Punctuator                                  d.  Types and casting
                    3.  What is a named memory location where a value is being stored?
                       a.  Separator                                   b.  Variable
                       c.  Data type                                   d.  Sum
                    4.  int a=5;
                       What is “a” in the above code?
                       a.  Punctuator                                  b.  String
                       c.  Identifier                                  d.  Literal



                                                                                                                       137
                                                                         Primitive Values, Wrapper Classes, Types and Casting   137
   134   135   136   137   138   139   140   141   142   143   144