Java scanner as an attribute in a class : <p>So I don't know how to use scanner as an attribute of my class and then use that attribute to read things.</p>

<pre><code>private Scanner scannerName;

public theClassImUsing(){
    in = new Scanner(System.in);
}
System.out.println("Command &gt; ");
String comando = in.nextLine();
System.out.println("You just wrote: " + comando);
</code></pre>
