Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
// Java0724.java
The difference is 50
// This program demonstrates that parameter sequence matters.
// In this example method <showDifference> will display different
// results when the calling parameters
are reversed.
The difference
is -50
public class Java0724
{
public static void main(String args[])
{
int num1 = 100;
int num2 = 50;
showDifference(num1, num2);
showDifference(num2, num1);
}
public static void showDifference(int a, int b)
{
System.out.println();
int difference = a â b;
}
}
System.out.println("The difference is " + difference);
System.out.println();