You can't return twice, you can only have 1 return statement.
return random;
return random2; // This one will never be reached since you've already returned from the method.
If a method has a return value, like this one returns an int, the method must return at least one value. Any instructions after return statement, if the return is not surrounded by a branch itself, will be unreachable and throw a compilation error, as you've seen.
I'll explain the multiple branches with a couple examples:
public int someMethod(int i) {
if(i == 0) {
return i;
}
}
This method will not compile due to the fact that what happens if i is not equal to 0, the compiler does't know how to return the method. To fix this, either add an else, or a final return statement, either of these will work.
public int someMethod(int i) {
if(i == 0) {
return i;
}
return 2;
}
Or:
public int someMethod(int i) {
if(i == 0) {
return i;
} else {
return 2;
}
}
Now the compiler knows if i is not 0, it can return a value of some sort.
Also, unrelated note, but glancing at how you wrote your code, I'm guessing your coming from a C background. Just a heads up, all of your methods and variables are what is known as default scope, or package-private. Even though the class is declared public, these will only be able to accessed by the class itself, and classes that share the same package with it.
Might want to look here:
http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html