If I write the following class:
public class Example { int j; int k; public Example(int j, int k) { j = j; k = k;
To avoid this, use an IDE (like Eclipse) and it will generate warnings in this case.
Also, make your fields final unless they absolutely can't be. There are a number of reasons (apart from this one) to do that.