lFunctions in Java are called methods (OOP terminology) and can only be defined as part of a class
•Luckily,
they have the same format we are used to – with return types, argument lists, bodies and return abilities
lFormal arguments have a data type followed by the argument’s identifier
•Unlike
C++, you do not get to select whether they are passed by value or by reference.
•Technically, you could argue that everything is passed
by value.
•Primitive types are passed by value on the stack (you
have no choice) and
•Object
references are also passed by value on the stack (keep in mind this is the reference not the object), which “feels” like pass
by reference
•Again,
for user defined types, they are actually references automatically (no – you don’t put the & or the * in Java in your
argument lists!)