Professional Documents
Culture Documents
Java
Java
ë The thought process that one should use to arrive at an
answer is purposely illustrated above. Without knowing the
exact answer beforehand, you can arrive at an approximate
one by applying some basic knowledge of Java. Most
interviewers wouldn't expect you to know how
System.out.println() works off the top of your head, but
would rather see you use your basic Java knowledge to
arrive at an answer that's close to exact.
ë The more exact answer is this: inside the System class is the
declaration of 'out' that looks like: 'public static final
PrintStream out', and inside the Prinstream class is a
declaration of 'println()' that has a method signature that
looks like: 'public void println()'.
!
!
"#
!$
!!
ë 0iven the previous information, it should be
easier to deduce an answer to the question. Since
the JVM must translate the bytecode into
machine language, and since the machine
language depends on the operating system being
used, it is clear that the JVM is platform
(operating system) dependent. This fact can be
verified by trying to download the JVM - you will
be given a list of JVM's corresponding to different
operating systems, and you will obviously pick
whichever JVM is targeted for the operating
system that you are running.
$
!
!
ë the differences between overloading and
overriding. When overloading, one must
change either the type or the number of
parameters for a method that belongs to the
same class. But, à a method means
that a method inherited from a base class is
what's being changed.
'
!
( (
ë Java always provides a default, no-argument,
public constructor if no programmer-defined
constructor exists. Creating a private no-
argument constructor essentially prevents the
usage of that default constructor, thereby
preventing a caller from creating an instance
of the class. Note that the private constructor
may even be empty.
| '
(
$
$)
( (
ë The term 'class' refers to the actual written piece of
code in which the class is defined. The properties of a
class do not change before, during, or after the
execution of a program.