SCJP Certification

Sun Certified Java Programmer Certification exam essentials

September 3rd, 2011

What is agrregation?

No Comments, Java Facts, by Daisy Williams.

Aggregation is a type of association that specifies a whole/part relationship between the aggregate (whole) and a component part. It differs from composition in that it does not imply ownership. In composition, when the owning object is destroyed, so are the contained objects. Following are the characteristics of aggregation:

  1. It does not imply ownership.
  2. It is an asymmetric relationship.
  3. It is a transitive relationship.
  4. It implies stronger coupling behavior (copy, delete, etc.).

Share

September 1st, 2011

What is composition?

No Comments, Java Facts, by Daisy Williams.

When one object is responsible for the lifecycle management of another object, this relationship is known as composition. Composition represents a “has-a” type relationship. Compositions are a critical building block of many basic data structures, including the tagged union, the linked list, and the binary tree, as well as the object used in object-oriented programming. In UML, composition is depicted as a filled diamond and a solid line. It always implies a multiplicity of 1 or 0..1, as no more than one object at a time can have lifetime responsibility for another object. In an “is a” relationship, the derived class is clearly a kind of the base class.

Share

August 30th, 2011

What is the lowerKey() method?

No Comments, Uncategorized, by Daisy Williams.

The lowerKey(k) method of the NavigableMap interface returns the greatest key in the map strictly less than k. It returns a null value if no such key is found. The lowerKey(k) method throws the ClassCastException if the specified key cannot be compared with the keys currently in the map. It throws the NullPointerException if the specified key is null and the map does not permit null keys

Share

August 29th, 2011

What is the lowerEntry() method?

No Comments, Uncategorized, by Daisy Williams.

The lowerEntry(k) method of the NavigableMap interface returns a key value pair with the greatest key in the map strictly less than k. It returns a null value if no such key is found. The lowerEntry(k) method throws the ClassCastException if the specified key cannot be compared with the keys currently in the map. It throws the NullPointerException if the specified key is null and this map does not permit null keys

Share