انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Array of Object

الكلية كلية العلوم للبنات     القسم قسم الحاسبات     المرحلة 2
أستاذ المادة احمد علي حسين الجنابي       15/02/2017 05:43:20
Array of Object
Like array of other user-defined data types, an array of type class
can also be created. The array of type class contains the objects of
the class as its individual elements.
Thus, an array of a class type is also known as an array of objects. An
array of objects is declared in the same way as an array of any built-in data type.
The syntax for declaring an array of objects is
class_name array_name [size] ?
To understand the concept of an array of objects, consider this example.

In following example, an array of string of the type class books is declared. This implies
that book is an array of three objects of the class books.

When an array of objects is declared, the memory is allocated in the same way as to
multidimensional arrays. For example, for the array book, a separate copy of title and
price is created for each member book[0], book[l] and book[2]. However, member
functions are stored at a different place in memory and shared among all the array
members. For instance, the memory space is allocated to the array of objects book of
the class books,

Like array of other user-defined data types, an array of type class
can also be created. The array of type class contains the objects of
the class as its individual elements.
Thus, an array of a class type is also known as an array of objects. An
array of objects is declared in the same way as an array of any built-in data type.
The syntax for declaring an array of objects is
class_name array_name [size] ?
To understand the concept of an array of objects, consider this example.

In following example, an array of string of the type class books is declared. This implies
that book is an array of three objects of the class books.

When an array of objects is declared, the memory is allocated in the same way as to
multidimensional arrays. For example, for the array book, a separate copy of title and
price is created for each member book[0], book[l] and book[2]. However, member
functions are stored at a different place in memory and shared among all the array
members. For instance, the memory space is allocated to the array of objects book of
the class books,


المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .