Parameter Passing Mechanisms
An Introduction with Examples in Java
|
Prof. David Bernstein
James Madison University
|
|
Computer Science Department
|
bernstdh@jmu.edu
|
Passing Value Types
Trying to Swap Two Values
javaexamples/basics/ParameterPassingExample1.java
(Fragment: 0)
Parameter Reference Types (cont.)
Swapping the Attributes of Two Objects
javaexamples/basics/Pair.java
(Fragment: 0)
javaexamples/basics/ParameterPassingExample1.java
(Fragment: 1)
Parameter Reference Types (cont.)
Trying to Swap Two Objects
javaexamples/basics/Pair.java
(Fragment: 0)
javaexamples/basics/ParameterPassingExample1.java
(Fragment: 2)
Parameter Reference Types (cont.)
Swapping Two Elements of an Array
javaexamples/basics/ParameterPassingExample1.java
(Fragment: 3)
Parameter Reference Types (cont.)
Trying to Swap Two Arrays
javaexamples/basics/ParameterPassingExample1.java
(Fragment: 4)
There's Always More to Learn