Professional Documents
Culture Documents
b)
Link: http://searchsoftwarequality.techtarget.com/tip/Waterfall-or-Agile-Differences-between-
predictive-and-adaptive-software-methodologies
provides the interface between the user and the rest of the
input/output devices.
RPC's.
d)
Q2:
b)
- Binding of private, static and final methods always happen at compile time
since these methods cannot be overridden. When the method overriding is
actually happening and the reference of parent type is assigned to the
object of child class type then such binding is resolved during runtime.
- Difference between overloading a method name and overriding a method name that
that:
Overloading method Overriding method
Q3:
a) - Explain why it is important to make mutable data members of a Java class private:
-> Otherwise other classes can modify your private implementation details and the
class that owns the member won't even know about it. This can break all your invariants, all
the guarantees you expect to hold true inside that class.
- No real way to get around the consequences except not to expose those members
in the first place. Make them private and make the type immutable. It's the only way
b) - Persistence, in computer science, is an adjective describing data that outlives the
process that created it.
- Object serialization is the Java language-specific mechanism for the storage and retrieval of
Java objects and primitives to streams
c)
Way 1:
Way 2:
d)
Shallow Copy Deep Copy
Cloned Object and original object are not 100% Cloned Object and original object are 100%
disjoint. disjoint.
Any changes made to cloned object will be Any changes made to cloned object will not be
reflected in original object or vice versa. reflected in original object or vice versa.
Default version of clone method creates the To create the deep copy of an object, you have to
shallow copy of an object. override clone method.
Shallow copy is preferred if an object has only Deep copy is preferred if an object has references
primitive fields. to other objects as fields.
Shallow copy is fast and also less expensive. Deep copy is slow and very expensive.
Deep copy of an object will have exact copy of all the fields of original object just like shallow copy. But
in additional, if original object has any references to other objects as fields, then copy of those objects
are also created by calling clone() method on them. That means clone object and original object will be
100% disjoint. They will be 100% independent of each other. Any changes made to clone object will not
be reflected in original object or vice-versa.
Q4:
Q5:
a)