what is mean by aggregation? and what is mean by association? explain with an example?
View Answers
September 11, 2008 at 3:43 PM
Hi friend,
Association It is a relationship between classes of objects which allows one object instance to cause another to perform an action on its behalf. This relationship is structural, because it specifies that objects of one kind are connected to objects of another.
Aggregation:
In aggregation , one object is composed of multiple objects and every object is useless without the relationship. Suppose there is a car object, so car object is useless without the tyre or steering object, and steering object is useless without car. This type of relationship is called Aggregation.
Thanks
September 11, 2008 at 3:46 PM
Hi friend,
Aggregation is a special kind of association that specifies a whole/part relationship between the aggregate (whole) and a component part. When compared to an ordinary association, some distinguishing characteristics of aggregation include:
* aggregation is an asymmetric relationship * aggregation is a transitive relationship * aggregation implies stronger coupling * behavior (copy, delete, etc.) is normally propagated across an aggregation.
Aggregation is one of two fundamental possibilites to build new classes from existing ones.
September 11, 2008 at 4:52 PM
public class throwtest { public static void main(String argv[]) { int i; try { i = Integer.parseInt(argv[0]); } catch (ArrayIndexOutOfBoundsException e) { System.out.println("Must specify an argument"); return; } catch (NumberFormatException e) { System.out.println("Must specify an integer argument."); return; }
addValue(i); } public static void addValue(int i) { try { b(i); } catch (MyException e) { if (e instanceof MySubException) System.out.print("MySubException: "); else System.out.print("MyException: "); System.out.println(e.getMessage()); System.out.println("Handled at point 1"); } } public static void b(int i) throws MyException { int result; try { System.out.println("Enter number is = " + i + "."); result = c(i); System.out.println("Add Result is = " + result +"."); } catch (Exception e) { System.out.println("Exception: " + e.getMessage()); System.out.println("Handled at point 2"); } finally { System.out.print("\n"); } } public static int c(int i) throws MyException, MyOtherException { switch (i) { case 0: throw new MyException("input is low"); case 1: throw new MySubException("input still too low"); case 120: throw new MyOtherException("input is high"); default: return i+ i; } } }
-----------------------------------
Thanks.
Related Pages:
OOPs
OOPs What is OOps? Object oriented programming organizes a program around its data,i.e.,objects and a set of well defined interfaces to that data.An object-oriented program can be characterized as data controlling
oops concepts oops concepts What is polymorphism?Explain with an example.
What is abstraction?Explain with an example.
What is inheritance?Explain with an example.
What is encapsulation?Explain with an example
Java & OOPs
Java & OOPs Is JAVA a fully Object Oriented Language? or A what degree Java supports Fully OOPs concept?
Java is not a fully object oriented language because
Java is not a completely object oriented language
What is oops in php with example?
What is oops in php with example? Hi,
I heard some where that PHP is support OOPS and its new feature is PHP. Every is now using OOPs in PHP. What is oops in php with example? Can anyone give me code example?
Thanks
What is OOPs in PHP ?
What is OOPs in PHP ? Hi,
I am a beginner in PHP Programming Application. I have some doubt on What is OOPs in PHP programming. How the OOPs concept helps us in PHP Programming. Please provide me any online reference so that i
Oops Definition - Java Beginners Oops Definition What is Abstraction and Encapsulation? What is the Difference Between Abstraction and Encapsulation?
Regards
M.KethraBalan. Hi Friend,
Abstraction - The process of abstraction in Java is used
oops concepts - Java Interview Questions oops concepts what stands for "S" in OOPs ? object oriented programing..... Hi friend,
Object Oriented Programming or OOP is the technique to create programs based on the real world. Unlike procedural programming
using oops concepts - Development process
using oops concepts You are required to develop a Hotel Reservation System.
The system manages information about rooms, reservations, customers... total source code in corejava using oops concepts. Hi
using oops concepts - Development process
using oops concepts i want answer with oops concepts.individual classes with source code and exact out put.
You are required to develop a Hotel Reservation System.
The system manages information about rooms
OOPs Concept OOPs Concept
 ...
the OOPs concepts along with
fundamentals used to develop the java.... This is a technique
used to create
programs around the real world entities. In OOPs
OOPs concepts in Java
Object-Oriented Programming (OOPs) concepts in Java helps in creating programs that are based on real world.
OOPs is very flexible and compatible and hence... application that are developed on the OOPs concepts at first analyze the program
OOPS Concept Abstraction with example - Java Beginners OOPS Concept Abstraction with example I am new to java. In java OOPS concept Abstraction means abstract or something. Please explain it with one example Hi Friend,
The process of abstraction in Java is used
Program to read 2 integers using oops concepts
Program to read 2 integers using oops concepts Write a program to read two integers with the following significance.
? The first integer value represents a time of day on a 24 hour clock, so that 1245 represents quarter
Inheritance in Java 7
This tutorial describe concept of Inheritance. It is one of OOPs concept
Polymorphism in Java 7
This tutorial describe concept of Polymorphism. It is one of OOPs concept
Java7 : OOPs Concepts
JAVA7 : OOPs Concept
In this section we will discuss concept of Object..., better termed as OOPs is a paradigm where
everything is represented as an object.... Everything in OOPs is written inside the
class so that you can reuse the class.You
OOPs and Its Concepts in Java OOPs and Its Concepts in Java
Brief Introduction to OOP
Object Oriented Programming or
OOP is the technique to create programs based on the real world. Unlike
OOP
OOP
OOPs stands...
and scenerios. OOPs enables to program the real world objects and easily play
with them in our application development scenerios. OOPs focuses on the
relevant data
Object-Oriented Language: Java / APIs, Java OOPs
Java OOPs
In this section we will learn Object Oriented (OOPs) Concepts of Java.
This will give you brief introduction to the oops features of Java.
Java is one of the useful Object Oriented programming language. Other Object
Encapsulation in Java 7
Encapsulation in Java 7
This tutorial describe concept of Encapsulation. It is one of OOPs concept.
Encapsulation :
Encapsulation is a way of wrapping up data
and methods into a single unit. Encapsulation puts the data safe from
Abstraction in Java 7
Abstraction in Java 7
This section elaborate about abstraction. It is one of OOPs concept.
Abstraction :
Abstraction means hiding the unnecessary
information to the user and show only essential features of a particular concept
Polymorphism
Polymorphism
OOPs revolve around the four concepts:
1. Encapsulation
2. Polymorphism
3. Abstraction
4. Inheritance
In OOPs, these concepts are implemented through
Encapsulation
Encapsulation
OOPs revolve around the four concepts:
1. Encapsulation
2. Polymorphism
3. Abstraction
4. Inheritance
In OOPs, these concepts are implemented through a class
Inheritance
Inheritance
OOPs revolve around the four concepts:
1. Encapsulation
2. Polymorphism
3. Abstraction
4. Inheritance
In OOPs, these concepts are implemented through a class
Java as an Object Oriented Language
will
discuss the OOPs concepts along with their role in developing
the java... entities. In OOPs programming model,
programs are developed around data rather than actions and logics.
In OOPs, every real life object has properties and behavior
Abstraction in Java
Abstraction in Java
Abstraction is one of the four pillar of OOPS Concept. Abstraction in java is a process by which hiding
the irrelevant data and exposing
only the
essential feature of object. In java Abstraction
Inheritance in Java
Inheritance, one of the important concepts of Object Oriented Programming (OOPS) defines a general class and establishes a subtype from an existing object.
Benefit of using inheritance:
A code can be used again and again
Difference between C++ and Java
Java and C++ are Object Oriented Programming (OOPs) language. Java is derived from C++ , hence both has many similarities. C++ is considered more complex when compared to Java . C++ was designed for infrastructure
java
java which one is purely based on oops 1)java 2)c++
Hi Friend,
Java is purely oops based language.
Thanks
Features of Java
Java is a class based Object Oriented Programming (OOPs) language, which...:
Java is an Object Oriented Programming (OOPs) language and provides simple... supports following four characteristics of OOPs:
Inheritance:
Process
update query
update query using oops concept in php.. How to update the data from databse ? with program example
Encapsulation in Java
Encapsulation along with Inheritance, Polymorphism, and Abstraction are the four concepts of Object Oriented Programming (OOPs). Encapsulation in Java is the technique of binding or wrapping the data and the codes in a class private
Object Oriented Programming in PHP
Object Oriented Programming in PHP Hi,
Which version of PHP supports OOPS. How can I learn Object Oriented Programming in PHP?
Thanks
question
question which language is leading the world java or .net
and which language followed by all the Oops principles either java or .net
Difference between Java and C++
Difference between Java and C++
Java is an Object Oriented Programming(OOPs) language, developed by James
Gosling 1992. Important feature of java is that it allows the developer to
Write Once Run Anywhere (WORA) meaning
Object Oriented concepts
to
develop programs revolving around the real world entities. In OOPs programming
model, programs are developed around data rather than actions and logics. In
OOPs... type) and behavior (methods).
OOPs provides a better flexibility
basic java - Java Beginners
basic java oops concept in java ? Hi Friend,
Please visit the following links:
http://www.roseindia.net/java/beginners/oop-in-java.shtml
http://www.roseindia.net/java/learn-java-in-a-day/oops.shtml
Thanks
Is Java a pure object oriented language?
programming language but not purely a object oriented language. In OOPs programming.... In OOPs, every real life object has properties and behavior. which is achieved