Get the most accurate GSEB Solutions for Class 12 Computer Chapter 06 Object Oriented Concepts here. Updated for the 2026-27 academic session, these solutions are based on the latest GSEB textbooks for Class 12 Computer. Our expert-created answers for Class 12 Computer are available for free download in PDF format.
Detailed Chapter 06 Object Oriented Concepts GSEB Solutions for Class 12 Computer
For Class 12 students, solving GSEB textbook questions is the most effective way to build a strong conceptual foundation. Our Class 12 Computer solutions follow a detailed, step-by-step approach to ensure you understand the logic behind every answer. Practicing these Chapter 06 Object Oriented Concepts solutions will improve your exam performance.
Class 12 Computer Chapter 06 Object Oriented Concepts GSEB Solutions PDF
Gseb Solutions
Question 1. List the features supported by object-oriented programming language.
Answer: Object-oriented programming languages support various features, including:
- In the real world, objects are the things that make up the world.
- Some objects are real things like people, cars, or coffee cups.
- Other objects might be ideas, not actual things you can touch or see; for instance, dates and times.
- Every object has its own unique identity and can be told apart from others.
- For example, every person has traits like name, city, gender, birth date, and job.
- In object-oriented language, these traits are called properties or attributes.
- To tell one person from another, we use the values of these traits.
- The names 'Ram' and 'Shyam' point to two distinct individuals.
- If two people share the same name, you can tell them apart using another trait, like their birth date.
- To identify objects, we use the values of these attributes.
- These values are known as state.
- Also, objects have a behavior linked to them.
- For example, a person is born, gets a name, and changes location.
- This behavior is also called a method.
- The object's state can change due to its behavior.
- So, you can describe any real object by its name (identity), what it currently is (its state), and what it does (its behavior).
- In object-oriented programming, attributes that describe the object are also referred to as data fields.
- The data attributes and behavioral methods linked with an object are together known as its members or features.
- When any software application is designed, the objects considered should be relevant to the application.
- For instance, in a railway reservation application, relevant objects are train, passenger, ticket, or station.
- Objects like cars, computers, and watches might not be relevant here.
In simple words: Object-oriented programming uses 'objects' that have unique features and can perform actions. These objects can be concrete or abstract, and they have distinct identities. Key ideas include attributes (properties), methods (behaviors), and the concept of an object's state.
Exam Tip: When listing features of OOP, remember to cover the fundamental concepts like objects, attributes, methods, state, and identity, as these are core to understanding OOP.
Question 2. Distinguish between class and object.
Answer:
Object:
- In the real world, objects are the things that make up the world.
- Some objects are real things like people, cars, or coffee cups.
- Other objects might be ideas, not actual things you can touch or see; for instance, dates and times.
- Every object has its own unique identity and can be told apart from others.
- For example, every person has traits like name, city, gender, birth date, and job.
- In object-oriented language, these traits are called properties or attributes.
- To tell one person from another, we use the values of these traits.
- The names 'Ram' and 'Shyam' point to two distinct individuals.
- If two people share the same name, you can tell them apart using another trait, like their birth date.
- To identify objects, we use the values of these attributes.
- These values are known as state.
- Also, objects have a behavior linked to them.
- For example, a person is born, gets a name, and changes location.
- This behavior is also called a method.
- The object's state can change due to its behavior.
- So, you can describe any real object by its name (identity), what it currently is (its state), and what it does (its behavior).
- In object-oriented programming, attributes that describe the object are also referred to as data fields.
- The data attributes and behavioral methods linked with an object are together known as its members or features.
- When any software application is designed, the objects considered should be relevant to the application.
- For instance, in a railway reservation application, relevant objects are train, passenger, ticket, or station.
- Objects like cars, computers, and watches might not be relevant here.
Class:
- From the example of a person object, it's clear that different objects with the same traits and behaviors differ only in the state (data values) they hold.
- An object-oriented system uses the idea of a class to describe a group of objects that are essentially similar, differing only in their attribute values.
- A class can be thought of as a blueprint for various objects.
- It serves as a template for many objects with similar features.
- It outlines a group of objects that share common attributes and behaviors.
- Objects within the same class have a shared meaning or purpose.
- Therefore, a class is a general concept that gathers all the common features of a specific set of objects.
- For example, we have a class named 'Person' that defines common attributes and behaviors for all persons.
- Individual persons are then objects and are identified by their state; that is, the values of their attributes.
In simple words: An object is a specific item or instance (like 'your car'), while a class is a blueprint or template that defines what those objects should look like and how they should act (like 'the car model'). You can make many different objects from one class.
Exam Tip: To differentiate between class and object, remember that a class is a general template (like a cookie cutter) and an object is a specific instance created from that template (like an actual cookie). Give concrete examples for clarity.
Figure shows difference between the class and its objects
Figure: Class 'Person' and its Objects
Question 3. Differentiate between ‘Encapsulation' and 'Data Abstraction'.
Answer:
Encapsulation
- For any computer program, data and functions are two or more elements.
- Structured or procedural programming views these two main elements as separate entities; however, object-oriented programming sees them as a single entity.
- In procedural programming, any part of the program can change data. It is not protected from changes.
- In object-oriented programming, this issue can be fixed using encapsulation.
- Here, data and the methods that work with data are protected from changes or incorrect use by other parts of the program.
- This process of protecting program data and methods is called encapsulation.
- This is possible by wrapping data and methods into a single unit, known as a class, and making them private.
- Private members of the class cannot be directly accessed from outside the world.
- If needed, the data is made available through public methods.
- Thus, encapsulation offers the ability to hide data.
- Encapsulation keeps data safe from accidental actions and unwanted access by outside objects.
- Unlike procedural programming, where common data areas are often used for sharing information, object-oriented programming discourages direct access to shared data (other than using global variables) by other programs.
- Only the object that 'owns' the data can change its content.
- Other objects can view or change this data by sending a message to the "owner."
Data Abstraction
- Data abstraction is a method of showing the key features of objects without including all the implementation details.
- Abstraction is an idea that hides complexity; it explains what something does, but not how it is done.
- Consider a real example of a television set. The TV can be turned off and on, channels can be changed, and volume can be adjusted. However, the user doesn't know the inner workings, like how it receives signals, translates them, and shows them on the screen.
- There is a clear separation between the TV's internal implementation and its external interface.
- You can operate it using external controls like the power button, channel changer, and volume control, without knowing any of its internal parts.
- Data abstraction, therefore, is a method that relies on separating the interface from the implementation.
- This is not a new idea in programming.
- Most people already use it to some extent, probably without realizing it. For example, when a programmer uses functions like \( \text{sqrt(25)} \) and \( \text{printf("Hello world")} \) in C programming, they never consider how these are implemented.
- A user-defined function with necessary input data parameters also provides data abstraction.
- Consider a C program that uses a structure to declare a 'date' type of data.
- Here, a date consists of three elements: day, month, and year. We use primitive integer data types for these elements.
- Imagine a function called 'dateDiff' that takes two dates as parameters and returns the number of days between them.
- The user of this function does not need to know how this difference is calculated.
- It is only necessary to know the function's signature; that is, its name, the number and type of parameters, and the return type.
- If there is any change in how the difference is found, it does not affect the part of the program using this function.
- Thus, data abstraction offers the basic structure or templates for our use. The system hides certain specific details about how data is stored, created, and maintained.
- All that the rest of the world sees is the abstract behavior of the data type; details of how this behavior is carried out are hidden, allowing them to be changed as needed without affecting others.
- Abstract Data Types (ADT) or structures (struct) in C/C++, and classes/Java, are examples of data abstraction.
- In ADT, a data type and a set of operations on it are simply defined. The implementation of operations is not visible.
- The main difference between data encapsulation and data abstraction is: Encapsulation protects data by making it unavailable from outside, and abstraction allows data to be represented with hidden implementation details (abstracted).
In simple words: Encapsulation bundles data and methods together and hides them to protect them, like keeping all parts of a car engine under the hood. Data abstraction, on the other hand, shows only the important information and hides the complex details, like showing only the car's steering wheel and pedals to the driver, not all the engine's inner workings.
Exam Tip: Clearly define each term first, then use a common example (like a car or TV) to illustrate how they differ. Focus on "bundling and protection" for encapsulation and "showing essentials, hiding details" for abstraction.
Question 4. What do you mean by polymorphism ? Name two type of overloading that may be supported to achieve polymorphism.
Answer:
- Polymorphism means 'many forms'. A single method of operation can have different forms.
- Assume a written function named 'max' that finds the maximum of two numbers.
- It takes two integers as parameters and returns the maximum as an integer value.
- Now suppose the user wants to add another function named 'max' that finds the maximum of integer elements stored in an array. It takes the array and its size as parameters and returns the maximum integer.
- In some programming languages, it's not possible to define more than one function with the same name.
- However, in object-oriented programming, it is possible as long as the method's signatures (number and type of parameters) are different.
- Object-oriented programming also allows defining more than one method with the same name but different signatures within a single class. This feature is known as function or method overloading.
- Object-oriented programming also allows writing expressions that use operators on objects.
- For example, the expression 'date1-date2' can be used when both operands are objects of the 'date' class. Here, the '-' operation is performed differently than subtracting two numbers, like n1-n2. The same operation is given different meanings depending on the data type of the operands used.
- This type of polymorphism is achieved through operator overloading.
- Thus, polymorphism is achieved using two types of overloading: function overloading and operator overloading.
- Generally, the ability to use the same names to mean different things in various contexts is called overloading.
In simple words: Polymorphism means "many forms" – it lets you use one name for different actions depending on the situation. You can achieve it through function overloading (same function name, different inputs) and operator overloading (operators like '+' doing different things for different data types).
Exam Tip: Always remember that polymorphism is about "one interface, multiple implementations." For overloading, highlight how the *signature* (parameters) or the *context* (operands) changes the behavior of a function or operator.
Question 5. Explain the use of aggregation and composition.
Answer: When objects of one class are made up of objects from another class, it's called aggregation or composition.
- It represents a 'has-a' or 'a-part-of' relationship between classes. For example, a motherboard is a part of a computer.
- We all know that a computer is made of many parts like a motherboard, screen, keyboard, and mouse. A screen itself might be a class with attributes like length, width, and model. Similarly, a motherboard might be defined as a class with attributes like model and company. When we define a 'computer' class, it will contain attributes that are objects of the 'motherboard' and 'screen' classes. This implies containment.
- For example, let's change the 'Person' class discussed earlier. First, define two new classes, 'Name' and 'Address', as shown in the figure. The 'Name' class has attributes for first name, middle name, and last name. The 'Address' class has attributes for house details, street, city, state, and pin code.
- Modify the 'Person' class and change the names of the attributes 'name' and 'address' to 'nm' and 'addr', respectively. The data types of 'nm' and 'addr' attributes are 'Name' and 'Address' classes, respectively. Thus, the 'Person' class contains objects of the 'Name' and 'Address' classes.
In simple words: Aggregation and composition describe how objects are made of other objects. Aggregation means one object "has" another, but they can exist separately (like a car "has" wheels, but wheels can exist alone). Composition means one object "is made of" another, and if the main object is destroyed, the parts are too (like a human "is made of" a heart, and the heart can't exist without the human).
Exam Tip: The key difference between aggregation and composition lies in the lifetime dependency. Use an empty diamond for aggregation (independent lifetime) and a filled diamond for composition (dependent lifetime) in UML diagrams, and explain this dependency clearly.
Figure 6.5: Class 'Person' with attributes of class 'Name' and 'Address'
Figure: Diagram of the Class 'Person'
Question 6. When should one use inheritance ? Give example.
Answer:
- Inheritance is generally known as an 'is-a-kind-of' relationship between two classes.
- It is suitable when one class is 'a kind of' another class. For example, a teacher is a type of person.
- So, all the attributes and methods of the 'Person' class apply to the 'Teacher' class as well. In other words, the 'Teacher' class gets all the attributes and behaviors of the 'Person' class. The 'Teacher' class may have additional attributes like 'subject' and methods like 'taking lectures' on the subject.
- In such a situation, the 'Teacher' class can be defined using 'Person'.
- Inheritance refers to the ability to define a new class of objects that gets the characteristics of another existing class.
- In object-oriented terms, the new class is called a subclass, child class, or derived class; while the existing class is called a superclass, parent class, or base class.
- The data attributes and methods of the superclass are available to objects in the subclass without needing to rewrite their declarations.
- This feature provides reusability, where existing methods can be reused without redefining them.
- Additionally, new data and method members can be added to the subclass as an extension.
- It also allows methods to be refined in the subclass as needed.
- In a class diagram, inheritance is shown using an arrow pointing to the superclass, as depicted in the figure. In this example, 'Person' is a superclass, and 'Teacher' is a subclass.
In simple words: You use inheritance when one type of object is a specific version of another (e.g., a "Teacher" IS A "Person"). It helps reuse code by letting new classes get all the traits and actions from an existing class, making your code cleaner and easier to manage.
Exam Tip: Always remember inheritance as an "is-a" relationship. When designing, identify common traits and behaviors to put in a superclass, then create subclasses for more specific types to promote code reusability and maintainability.
Figure: Example of Inheritance
Figure: Example of multilevel inheritance
Question 7. Explain different types of inheritance.
Answer:
- Inheritance is generally known as an 'is-a-kind-of' relationship between two classes.
- It is suitable when one class is 'a kind of' another class. For example, a teacher is a type of person.
- So, all the attributes and methods of the 'Person' class apply to the 'Teacher' class as well. In other words, the 'Teacher' class gets all the attributes and behaviors of the 'Person' class. The 'Teacher' class may have additional attributes like 'subject' and methods like 'taking lectures' on the subject.
- In such a situation, the 'Teacher' class can be defined using 'Person'.
- Inheritance refers to the ability to define a new class of objects that gets the characteristics of another existing class.
- In object-oriented terms, the new class is called a subclass, child class, or derived class; while the existing class is called a superclass, parent class, or base class.
- The data attributes and methods of the superclass are available to objects in the subclass without needing to rewrite their declarations.
- This feature provides reusability, where existing methods can be reused without redefining them.
- Additionally, new data and method members can be added to the subclass as an extension.
- It also allows methods to be refined in the subclass as needed.
- In a class diagram, inheritance is shown using an arrow pointing to the superclass, as depicted in the figure. In this example, 'Person' is a superclass, and 'Teacher' is a subclass.
- Generalization is another term for inheritance or an 'is a' relationship.
- It describes a relationship between two classes where one class is a specialized version of another. Common attributes and methods are defined in the superclass.
- A subclass is a specialized version with additional attributes and methods.
- Sometimes, there might be a classic hierarchy of inheritance between classes. For instance, the 'Employee' class can be derived from the 'Person' class, and then the 'Teacher' class can be derived from 'Employee'. Here, an employee is a type of person, and a teacher is a type of employee.
- This type of inheritance is known as multilevel inheritance. An example of multilevel inheritance is shown in the figure above.
In simple words: Inheritance lets new classes (subclasses) get features from existing classes (superclasses), forming an "is-a-kind-of" link. Different types include single (one superclass), multilevel (a chain of superclasses), and hierarchical (one superclass with multiple subclasses), all aimed at reusing code.
Exam Tip: When explaining types of inheritance, always start with the "is-a" relationship. For each type (single, multilevel, hierarchical, multiple), define it briefly and provide a clear, simple example to illustrate the concept.
Question 8. Choose the most appropriate option from those given below :
1) In Object-oriented methodology, the focus is on which of the following entities ?
(a) Data
(b) Functions
(c) Objects
(d) All of the options
Answer: (c) Objects
In simple words: Object-oriented programming centers around 'objects' as its main building blocks.
Exam Tip: Remember that in OOP, the core idea is to combine data and functions into cohesive 'objects', shifting focus from procedural functions to these self-contained units.
Question 8. Choose the most appropriate option from those given below :
2) Which of the following best suits to Java ?
(a) A procedural programming language
(b) An Object-oriented programming language
(c) A Query language
(d) All of the options
Answer: (b) An Object-oriented programming language
In simple words: Java is a programming language specifically designed to use object-oriented methods.
Exam Tip: Java is a prime example of a pure object-oriented language. Knowing key OOP languages helps solidify understanding of the paradigm.
Question 8. Choose the most appropriate option from those given below :
3) Which of the following is used to distinguish objects from each other ?
(a) Attributes
(b) State
(c) Behaviour
(d) All of the options
Answer: (b) State
In simple words: The unique 'state' (current values of its attributes) of an object is what makes it different from other objects.
Exam Tip: An object's identity is defined by its unique state (attribute values), not just its behavior or general characteristics. Think of two identical cars; their states (mileage, fuel level, owner) distinguish them.
Question 8. Choose the most appropriate option from those given below :
4) Which of the following is used to define common features of similar objects ?
(a) Class
(b) Object
(c) Methods
(d) All of the options
Answer: (a) Class
In simple words: A 'class' serves as a blueprint to outline the shared characteristics and actions of similar objects.
Exam Tip: Remember that a class is the template, while an object is an instance of that template. The class establishes the common structure for all objects derived from it.
Question 8. Choose the most appropriate option from those given below :
5) Which of the following is not a visibility symbol ?
(a) \( \sim \)
(b) \( * \)
(c) \( \# \)
(d) \( - \)
Answer: (b) *
In simple words: In programming, specific symbols like tilde, hash, and hyphen show how visible or accessible parts of code are, but the asterisk is not used for this purpose.
Exam Tip: Familiarize yourself with common visibility modifiers in object-oriented languages (e.g., public, private, protected) and their corresponding symbols in UML diagrams if applicable. \( * \) is typically a wildcard or multiplication operator.
Question 8. Choose the most appropriate option from those given below :
6) Which of the following is provided using encapsulation?
(a) Data protection
(b) Data sharing
(c) Separation of data and methods
(d) All of these
Answer: (a) Data protection
In simple words: Encapsulation's primary goal is to protect data by bundling it with methods that operate on it, restricting direct external access.
Exam Tip: Encapsulation is primarily about data hiding and protection. While it bundles data with methods, its core benefit is safeguarding internal state from unintended external modifications.
Question 8. Choose the most appropriate option from those given below :
7) Which of the following is enabled by data abstraction ?
(a) Data protection
(b) Data hiding
(c) To hide implementation details of method manipulating the data
(d) All of these
Answer: (c) To hide implementation details of method manipulating the data
In simple words: Data abstraction helps hide the complex inner workings of how data is handled, letting users focus only on what it does, not how it does it.
Exam Tip: Abstraction aims to simplify interaction by showing only essential information and hiding complex implementation details. It's about 'what' rather than 'how'.
Question 8. Choose the most appropriate option from those given below :
8) With which of the following options polymorphism cannot be achieved ?
(a) Method overloading
(b) Operator overloading
(c) Data hiding
(d) All of these
Answer: (c) Data hiding
In simple words: Polymorphism is achieved through method and operator overloading, allowing actions to take many forms, but data hiding (encapsulation) is a separate concept not directly used for polymorphism.
Exam Tip: Remember that polymorphism manifests through overloading (same name, different parameters/types) and overriding (different implementation in subclass). Data hiding is a feature of encapsulation, a distinct OOP principle.
Question 8. Choose the most appropriate option from those given below :
9) An aggregation model refers to which of the following relationships ?
(a) 'is-a' relationship
(b) 'is-like' relationship
(c) 'a-part-of' relationship
(d) All of these
Answer: (c) 'a-part-of' relationship
In simple words: Aggregation describes a connection where one object is a part of another, but can still exist on its own.
Exam Tip: Distinguish aggregation ('a-part-of' with independent existence) from composition ('a-part-of' with dependent existence) and inheritance ('is-a' relationship). Each represents a different structural connection between classes.
Question 8. Choose the most appropriate option from those given below :
10) An inheritance model refers to which of the following relationships ?
(a) 'is-a' relationship
(b) 'has-a' relationship
(c) 'a-part-of relationship
(d) All of these
Answer: (a) 'is-a' relationship
In simple words: Inheritance defines a connection where one class is a specialized type of another, often called an "is-a" relationship (e.g., a "dog" is an "animal").
Exam Tip: The "is-a" relationship is fundamental to inheritance, indicating that a subclass is a specialized version of its superclass and can perform all actions of the superclass.
Question 8. Choose the most appropriate option from those given below :
11) In class diagram, composition is represented using which of the following symbols ?
(a) Empty diamond symbol
(b) Filled diamond symbol
(c) Empty triangle symbol
(d) All of these
Answer: (b) Filled diamond symbol
In simple words: In class diagrams, a filled diamond symbol indicates composition, showing a strong "part-of" relationship where the component cannot exist without the whole.
Exam Tip: Remember the specific UML symbols for class relationships: empty diamond for aggregation (weak "has-a"), filled diamond for composition (strong "has-a"), and an empty triangle arrow for inheritance ("is-a").
Computer Class 12 Gseb Notes Chapter 6 Object-Oriented Concepts
Introduction
- Object-oriented programming ideas began emerging in the 1960s.
- Since the mid-1980s, it had become the main programming method used for creating new software.
- It was developed to help manage the quickly growing size and complexity of software systems and to make these large and complex systems easier to change over time.
- Some popular programming languages that support object-oriented programming include C++, Java, C#, VB.net, ASP.net, and PHP.
- Programming methods can be divided into two categories: structured/procedural and object-oriented.
- In procedural programming, the main focus is on functions that operate on data.
- For instance, for library application software, all processes of the library application focus on modules like student registration, book issuing, book returning, and fine calculation.
- In the object-oriented approach, the focus is on objects that contain both data and functionality together.
- For a library application, our focus is on the objects involved in the application.
Introduction to Class Diagram
- The class diagram presents a collection of classes, constraints and relationship among classes.
- Unified Modelling Language (UML) can be used to create models of object-oriented software to help with design of an application.
- UML is a visual modeling language defined and maintained by the Object Management Group (OMG).
- UML specifies several diagrams for representing different aspects of a software application.
- The purpose of the class diagram is to model the static view of an application.
- The class diagrams are the only diagrams which can be directly mapped with object-oriented languages and thus widely used among software developers.
- In class diagram, a class is represented with an icon using a rectangle split into three sections to present name, attributes and behaviour as follows :
- Name of the class in the top section.
- Attributes or properties of the class in the middle section.
- Behaviour or operations or methods of the class in the bottom section.
- Figure shows the pictorial representation of a class using UML convention, while figure shows the class diagram of Person.
UML Class Representation Convention:
- Class Name
- Visibility: data type = initial value
- Visibility operation (argument list): return type
Diagram of the Class 'Person'
Person Attributes and Methods:
- name: string
- city: string
- gender: char = 'M'
- -birthdate: date
- profession: string
- setBirthdate (d:int,m:int,y:int): date
- changeCity (newCity:string) :string
- display ()
- The class Person is intended to provide information that is useful in understanding the role of the class in the context of class diagram.
- It does not have to contain every attribute and operation of the class.
- As seen in figure in UML notation, an attribute is declared using following syntax : [<visibility>]attribute name> (:<attribute data type> [=<initial value>]]
- Here, items written in pair of square brackets [ ] are optional and user is supposed to specify the values for items enclosed in angle brackets < >. Visibility can be private, protected, public or package represented using symbols #, + and ~ respectively.
- Attribute generally refers to a variable.
- Data type and initial value identify the type of data stored and its value at the start of the program.
- Only attribute-name is mandatory and all other items are optional.
- Some examples of declaring attribute are as follows :
- name: string
- -balance: float = 0.0
- As seen in figure In UML notation, an operation is declared using following syntax : [<visibility>]<method narme>(parameter list separated by comma):<return data type>
- An example of a method in the previous example is setBirthdate(d:int, m:int, y:int) : date.
- Here the parameter can be specified with data type and optional default value; for example gender: char = 'M'.
- Parameters can also be specified as input or output depending on whether it is read only or not.
- UML diagrams are independent of the programming language used for coding an application.
- Some software developers prefer to specify attributes and operations in the more familiar format of a programming language instead of using the standard UML notation.
- Objects are presented using their state during execution of an application. Thus, objects are dynamic.
- Corresponding to figure an object (also called an instance) of class person is represented as shown in figure.
Objects p1 and p2 of Class 'Person'
Object p1: Person
- name = Dr. Mira
- city = Vadodara
- gender = 'F'
- birthdate = 15-05-1985
- profession = Doctor
- ...
Object p2: Person
- name = Prof. Shyam
- city = Ahmedabad
- gender = 'M'
- birthdate = 20-07-1975
- profession = Professor
- ...
Messaging
- In object-oriented terminology, a call to a method is referred to as a message. Due to encapsulation, all method calls are handled by objects that recognize the method.
- Different classes may have same methods with same name. For example, class 'date' has method named 'display' that displays the date object in specific format.
- Suppose there are other classes 'time' and 'person'; both having method with same name 'display'; to display time in specific format and to display the details of person respectively.
- When method 'display' is invoked in the program, it is determined using the object that invokes the method. For example, if 'display' is called by an object of 'person' class, it executes the display method defined in 'person' class.
Aggregation vs. Composition
- Aggregation represents non-exclusive relationship between two classes.
- In aggregation, the class that forms part of the owner class can exist independently.
- The life of an object of the part class is not determined by the owner class.
- For example, although the motherboard is part of the computer, it can exist as a separate item independent of the computer.
- The motherboard is not exclusively associated with computer.
Two 'Person' objects having different names but same address
Name Object n1:
- firstName: Shyam
- middleName: Mohan
- lastName: Yadav
- ...
Person Object p1:
- nm: Name(Shyam, Mohan, Yaduv)
- addr: Address (A/5....)
- gender: char = 'M'
- -birthdate: 20-07-1975
- profession: Professor
- ...
Name Object n2:
- firstName: Mira
- middleName: Mohan
- lastName: Yadav
- ...
Person Object p2:
- nm: Name(Mira, Mohan, Yadav)
- addr: Address(A/5....)
- gender: char = 'F'
- -birthdate: 15-05-1985
- profession: Doctor
- ...
Address Object adr1:
- house: A/5, Ashish
- street: M.G.Road
- city: Vadodara
- state: Gujarat
- pincode: 390002
- Basic aggregation is represented using an empty diamond symbol next to the whole class as shown in figure.
- Composition represents exclusive relationship between two classes.
- Composition is a strong type of aggregation where the lifetime of the part class depends on the existence of the owner class.
- If an object of aggregating class is deleted, its part class object also gets deleted.
- For example, when an object of class Person is deleted, the object of class Name is also deleted. Name is associated exclusively with single person as shown in figure .Composition relationships are represented using a filled diamond symbol next to the whole class as shown in figure.
Composition and Aggregation Figure Description:
- In the above example, a relationship between class 'Person1 and class 'Name' is composition relationship; whereas a relationship between class 'Person' and class 'Address' is aggregation relationship.
- Address may be shared by more than one person. So, when a person is deleted, the corresponding name object is deleted but address cannot be deleted.
- Note: The class that contains objects of other class is known as owner class or whole class or aggregating class. For example, the class 'Person' shown in figure is an aggregating class.
- The class that is contained in owner class is known as subject class or part class or aggregated class. For example, the classes 'Name' and 'Address' shown in figure are aggregated class.
Composition Vs. Inheritance
- In inheritance, class inherits from other classes in order to share, reuse or extend functionality. Here, there exists 'a kind of relationship between super class and sub class.
- In composition, classes do not inherit from other classes, but are 'composed of other classes. Class contains the attributes where some attributes are of objects of other class types.
- Note: There are other types of relationships and also constraints that can be represented in class diagram.
Free study material for Computer
GSEB Solutions Class 12 Computer Chapter 06 Object Oriented Concepts
Students can now access the GSEB Solutions for Chapter 06 Object Oriented Concepts prepared by teachers on our website. These solutions cover all questions in exercise in your Class 12 Computer textbook. Each answer is updated based on the current academic session as per the latest GSEB syllabus.
Detailed Explanations for Chapter 06 Object Oriented Concepts
Our expert teachers have provided step-by-step explanations for all the difficult questions in the Class 12 Computer chapter. Along with the final answers, we have also explained the concept behind it to help you build stronger understanding of each topic. This will be really helpful for Class 12 students who want to understand both theoretical and practical questions. By studying these GSEB Questions and Answers your basic concepts will improve a lot.
Benefits of using Computer Class 12 Solved Papers
Using our Computer solutions regularly students will be able to improve their logical thinking and problem-solving speed. These Class 12 solutions are a guide for self-study and homework assistance. Along with the chapter-wise solutions, you should also refer to our Revision Notes and Sample Papers for Chapter 06 Object Oriented Concepts to get a complete preparation experience.
FAQs
The complete and updated GSEB Class 12 Solutions Chapter 6 Object-Oriented Concepts is available for free on StudiesToday.com. These solutions for Class 12 Computer are as per latest GSEB curriculum.
Yes, our experts have revised the GSEB Class 12 Solutions Chapter 6 Object-Oriented Concepts as per 2026 exam pattern. All textbook exercises have been solved and have added explanation about how the Computer concepts are applied in case-study and assertion-reasoning questions.
Toppers recommend using GSEB language because GSEB marking schemes are strictly based on textbook definitions. Our GSEB Class 12 Solutions Chapter 6 Object-Oriented Concepts will help students to get full marks in the theory paper.
Yes, we provide bilingual support for Class 12 Computer. You can access GSEB Class 12 Solutions Chapter 6 Object-Oriented Concepts in both English and Hindi medium.
Yes, you can download the entire GSEB Class 12 Solutions Chapter 6 Object-Oriented Concepts in printable PDF format for offline study on any device.