Page 9 - Data Struct
P. 9

9
                   Algorithm and Data Structure


                   Differences Between Primitive  and Non-Primitive

                    Primitive                            Non-Primitive

                     •  Primitive data types are         •  Non-primitive data types are
                         predefined types of data,           not defined by the
                         which are supported by the          programming language, but
                         programming language                are instead created by the
                     •  For                                  programmer
                         example,integer, character,     •  They are sometimes called
                         and string are all primitive        "reference variables," or
                         data types.                         "object references," since they
                     •  Programmers can use these            reference a memory location,
                         data types when creating            which stores the data.
                         variables in their programs.    •
                     •  For example, a programmer
                         may create a variable called
                         "lastname" and define it as a
                         string data type. The
                         variable will then store data
                         as a string of characters.









                                                             Primitive      Non-
                                                                          Primitive


                                                                                   Non
                                                                     Linear       Linear



                                                             Dynamic        Static
   4   5   6   7   8   9   10   11   12   13   14