Im still learning and have noticed many inconsistencies when it comes to coding. I take it Java is pretty much like Photoshop in the way that a single task can be done many different ways and still have the job done.
One of my main questions is when it comes to Scanner and Random.
In one source they have Scanner in the scope of the whole class
public class test {
private static Scanner input = new Scanner(System.in);
}
In another source they have it like this
public class test {
private static Scanner input;
public static void main(String[] args) {
input = new Scanner(System.in);
}
}
What is the difference with this? Is there a right way and a wrong way?