Is there a difference between defining class attributes and initializing them? Are there cases where you want to do one over the other?
Example:
The following code snippets should point out the difference that I mean. I'm using a primitive and an object there:
import Java.util.Random;
public class Something extends Activity {
int integer;
Random random = null;
Something(){
integer = 0;
random = new Random();
....
vs.
import Java.util.Random;
public class Something extends Activity {
int integer = null;
Random random;
Something(){
integer = 0;
random = new Random();
....