Write a Java method to find the smallest number among three numbers.

Source Code:

public class SmallestNumber {
public static void main(String[] args) {
int result = findSmallest(12, 25, 8);
System.out.println(result);
}

public static int findSmallest(int x, int y, int z) {
if (x <= y && x <= z) {
return x;
} else if (y <= x && y <= z) {
return y;
} else {
return z;
}
}
}

Output: