Indian Webby

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Indian Webby

Place to raise your doubts...


    difference between abstract and primitive data types

    avatar
    sreekant
    Guest


    difference between abstract and primitive data types Empty difference between abstract and primitive data types

    Post  sreekant Fri Jan 09, 2009 1:16 am

    what is the difference between abstract and primitive data types.
    avatar
    Imran
    Guest


    difference between abstract and primitive data types Empty Reply:Abstract and Primitive Data Types.

    Post  Imran Fri Jan 09, 2009 11:47 am

    Abstract : A set of data values and associated operations that are precisely specified independent of any particular implementation.

    For Example : Stack is an Abstract Data Type.

    Methods involved in stack would be:
    - Push an element into the stack.
    - Pop and element from the stack.
    - Check the Top of the stack.

    Abstract Data Type : Abstract data type (ADT) is a specification of a set of data and the set of operations that can be performed on the data.

    Examples of Abstract Data Types:
    1. List
    2. Priority queue
    3. Queue
    4. Stack
    5. String
    6. Tree


    For Instance: User wants to makes certain calculations on 2 numbers (a and b).
    1. Create an instance of a rational number ADT using two integers, a and b.
    2. Operations: addition, subtraction, multiplication, division, exponentiation, comparison, simplify, conversion to a real (floating point) number.
    3. We write a Method performing the above functions by passing the variables a and b.

    Note: Taking the above definition into consideration here a and b are data values and addition, subtraction, multiplication, division, exponentiation, comparison, simplify, conversion to a real (floating point) number associated operations.

    --------------------------------------------------------------------------

    Primitive: being the first or earliest data types created by the designers of the programmers.

    For example early man are the Primitive people of the world.

    Primitive Data types : The Data types created for the usage in the programming language when the Programming language was first designed and launched.
    For example :

    Typical basic primitive types may include:

    1. Character (character, char);
    2. Integer (integer, int, short, long, byte).
    3. Floating-point number (float, double, real).
    4. Boolean having the values true and false.
    5. Reference (also called a pointer or handle), a small value referring to another object's address in memory, possibly a much larger one.

      Current date/time is Fri Nov 15, 2024 6:28 am