ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

What is the relationship between Class and Object ?

Class and object are two common terms in OOP, but what the different.

user-image
تم إضافة السؤال من قبل هاشم المشارقة , Key Account Manager , Advanced United Systems Ltd. ( A member of Taj Holding Group)
تاريخ النشر: 2014/09/02
Tomasz Modrzejewski
من قبل Tomasz Modrzejewski , Python Developer , Freelancer

To answer the question, let us ask the other: "What we call an object in the real world?" It turns out everything can be and is an object! Trees, animals, cities, cars, people ... Even activities can be reduced to the form of objects! In programming, an object can be any creature, about what we think. Creating "the world of the" you can create an object whose use will be more "tangible" a number of parameters, scattered in different variables. It differs from the structured programming object-oriented programming. Before you create an object, you need to determine what this object is? What it represents? What model is it? Depending on whether you want to create a virtual car, or plane, you must specify two things: »What properties - characteristics will have this property (eg. Length) »What will be the method of operation. (for example. accelerator as a function of acceleration) Therefore, before creating any object to be presented to the compiler its design (pattern), that determine its class. The class is therefore the object of programming determines what properties and methods will have objects that will be created on its basis. However, the project itself will not make again, that we get the objects. You still need to create an object, which simply means a declaration of an object based on a certain class.

lav kumar
من قبل lav kumar

object is inctance of class.instance means memory alloction at runtime of class.

class is define the structure state and behavoiur.state menas inctance data member of class and behavour means inctance method

Suraj  Umesh
من قبل Suraj Umesh , ASSISTANT DRILLER TRAINEE , National Drilling Company Offshore Rig

instances created in class are called as objects

Ehtesham Ahmad Siddiquie
من قبل Ehtesham Ahmad Siddiquie , Assistant system engineer , Tata Consultancy Services

A class in Java is a blueprint (template). It is a definition which contains the behaviour(method) and the state(attributes). This definition is not physical, which means that it does not occcupy any memory. An object is the instantiation of a class, which means that the definition of class is implemented physically by an object. Now to make the discussion simpler, A class is like an architectural drawing of a house. in the drawing it is defined what is the structure of the house, how many rooms it will have, etc. This is only a design but has no physical existence. When the house is actually constructed then the design comes into physical reality. This house is strictly defined by the drawing. Object is like the house which is defined by the class and has physical existence in memory.

anees anjum
من قبل anees anjum , Intern , Pakistan Ordinance Factories

A class is a blueprint of distinct user defined data type while an object is a variable of that user defined data type

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟