Answer 1 : A
Answer 2 : A
Answer 3 : D
Answer 4 : A
------Quote of the Day------
The Universal Truth
Tell a man there are 300 billion stars in the universe and he'll believe you. Tell him a bench has wet paint on it and he'll have to touch to be sure.
-Murphy
Tell a man there are 300 billion stars in the universe and he'll believe you. Tell him a bench has wet paint on it and he'll have to touch to be sure.
-Murphy
Wednesday, January 27, 2010
Monday, January 25, 2010
Story of the Day
One Day a 10 year boy entered a hotel coffee shop and sat at a table. A waitress put a glass
of water in front of him, "How much is an ice-cream ? ", he asked.
"seven Rupees ," replied the waitress.
The little boy checked how much money he had. "How much is a dish of plain ice-cream ?" he inquired.
Some people were waiting for table and the waitress was bit impatient . "Five Rupees," she replied.
"I'll have the plain ice-cream," he said.
The waitress brought the ice-cream, put the bill on the table and walked away.
The boy finished the ice-cream,paid the cashier and departed.When the waitress came back,
she began wiping down the table and then hardly swallowed what she saw.
There, placed neatly beside the empty dish, were two rupees-her tip.
of water in front of him, "How much is an ice-cream ? ", he asked.
"seven Rupees ," replied the waitress.
The little boy checked how much money he had. "How much is a dish of plain ice-cream ?" he inquired.
Some people were waiting for table and the waitress was bit impatient . "Five Rupees," she replied.
"I'll have the plain ice-cream," he said.
The waitress brought the ice-cream, put the bill on the table and walked away.
The boy finished the ice-cream,paid the cashier and departed.When the waitress came back,
she began wiping down the table and then hardly swallowed what she saw.
There, placed neatly beside the empty dish, were two rupees-her tip.
"Dear friends , one should not judge a person by his/her status but should always be polite and soft-spoken."
Some sample Questions on Relationship
Please click on images to view large Images.
Question-1
Question-2
Question -3
Question-4
" For Answers pls Wait for next POST "
Thursday, January 21, 2010
Finding Relationship among Classes
A Relationship may belongs to more than one Relation type at same time.In this case our answer should be the Strongest among them.
Dependency --> Association -->Aggregation--> Composition
-------------------------------------------------------------->
Strongness
For Example a relation b/w class A and B is as follows.
Dependency and Association and Aggregation and Composition
So in this case our answer should be Composition .
Now let's See how to Find Relationship among Classes:
1. If Class A is related to class B by any means there is dependency b/w class A and class B.
Eg:class A:
class A
{
void methodA( B b, int i )
{
System.out.print("i am B");
}
}
2. Now apart from Dependency a relation may be of type Inheritance or Association.
a> If there is any keyword 'extends ' is being used to relate these classes than it would be "Inheritance".
b> Else if class A Contains or Stores object of class B it would be "Association".
Else it would be only "Dependency".
3.If it is Association than
a> if Object of Class B is being created in Class A it Composition.
b> Else Object of Class B is passing as Parameter in any function of Class A
it is called "Aggregation ".
Here are some Examples to make things clear.
What is the relationship b/w class A and class B ?
class A {
public void methodA() {
B b = new B();
b.methodB();
}
}
class B {
public void methodB() {
}
}
Ans.1 Dependency
What is the relationship b/w class A and class B and b/w class A and C ?
Class A
{
private B b;
method( C c , int num);
}
Ans.2
Relationship between A and B is Association.
Relationship between A and C is Dependency.
Note: There is not any Difference b/w Association and Aggregation/Composition at Impementation level.
Note: For Aggregation and Composition classes should have 'Part - of' relationship.
For Any queries leave your Comment.
- Agam Gupta.
Dependency --> Association -->Aggregation--> Composition
-------------------------------------------------------------->
Strongness
For Example a relation b/w class A and B is as follows.
Dependency and Association and Aggregation and Composition
So in this case our answer should be Composition .
Now let's See how to Find Relationship among Classes:
1. If Class A is related to class B by any means there is dependency b/w class A and class B.
Eg:class A:
class A
{
void methodA( B b, int i )
{
System.out.print("i am B");
}
}
2. Now apart from Dependency a relation may be of type Inheritance or Association.
a> If there is any keyword 'extends ' is being used to relate these classes than it would be "Inheritance".
b> Else if class A Contains or Stores object of class B it would be "Association".
Else it would be only "Dependency".
3.If it is Association than
a> if Object of Class B is being created in Class A it Composition.
b> Else Object of Class B is passing as Parameter in any function of Class A
it is called "Aggregation ".
Here are some Examples to make things clear.
What is the relationship b/w class A and class B ?
class A {
public void methodA() {
B b = new B();
b.methodB();
}
}
class B {
public void methodB() {
}
}
Ans.1 Dependency
What is the relationship b/w class A and class B and b/w class A and C ?
Class A
{
private B b;
method( C c , int num);
}
Ans.2
Relationship between A and B is Association.
Relationship between A and C is Dependency.
Note: There is not any Difference b/w Association and Aggregation/Composition at Impementation level.
Note: For Aggregation and Composition classes should have 'Part - of' relationship.
For Any queries leave your Comment.
- Agam Gupta.
Subscribe to:
Comments (Atom)



