|
Authored by: xtifr on Monday, April 23 2012 @ 04:54 PM EDT |
I wrote: ...the compiler will know which method to use by
referring to the class of the object "lawyers".
A-a-and, before
anyone asks, no, the class of the object "lawyers" is not "low".
:)
--- Do not meddle in the affairs of Wizards, for it makes them
soggy and hard to light. [ Reply to This | Parent | # ]
|
|
Authored by: Anonymous on Monday, April 23 2012 @ 05:15 PM EDT |
1. The question is ambiguous. An API is just a
set of names, and
none of the names "call upon" other names.
However, Sun's implementation of the
APIs definitely
includes procedures that use the API. It's impossible to
write
any useful program in Java without calling some of the
API, and Sun's
implementation of the API consists of small
Java programs
(subroutines).
If a method in the API passes an object of a type
which is
defined elsewhere in the API, then can it not be said the
API 'calls
upon' other names?
[ Reply to This | Parent | # ]
|
|
Authored by: kuroshima on Monday, April 23 2012 @ 05:37 PM EDT |
First, what about when you pass an object of something
outside the accused packages (not APIs, calling them 37 APIs
when many of the packages are closely related is just
muddying the waters)?
Second, on the efficiency part: by grouping sin(x) and
cos(x), in the same package, you can have a private function
that handles both (since sin(a)=cos(4+90ยบ)). If there's a
bug, it will be solved at once for both, with no chance that
one is fixed while the other is not. Also, given that most
of the time you use sin, you also use cos, and their
inverses, having all them in a single class means that the
class loader does not need to load multiple classes.[ Reply to This | Parent | # ]
|
|
|
|
|