Q:

How do I use a scanner across multiple classes?

How can I use my Scanner user_input across multiple classes?  I have read a few articles, but apparently I am missing something.  I even tried following a few other stackoverflow questions, and the result is below:
import java.util.Scanner;

public class HelloWorld{
    public static final Scanner user_input = new Scanner(System.in);

    public static void main(String []args){
        String test1 = user_input.next();
        System.out.println("Test 1: " + test1);
    }
}

class TestClass{
    public static void test_method(){
        String test2 = HelloWord.user_input.next();
        System.out.println("Test 2: " + test2);
    }
}

If someone could help me, I would truly appreciate it.
P.S. I am new to Java, have background in Python.

A:

From @ferdz comment, something like this would be better:
import java.util.Scanner;

public class HelloWorld {
    public static final Scanner user_input = new Scanner(System.in);

    public static void main(String[] args) {
        String test1 = user_input.next();
        System.out.println("Test 1: " + test1);

        // These two lines actually instantiate the TestClass below,
        // we pass in the Scanner as a parameter (user_input), and 
        // then it gets used in the test_method internally.
        TestClass testClass = new TestClass(user_input);
        testClass.test_method();
    }

    private static class TestClass {
        public void test_method(Scanner scanner) {
            String test2 = scanner.next();
            System.out.println("Test 2: " + test2);
        }
    }
}

A:

Your only problem is you have missed spelt the word world in your second class.
So change:
String test2 = HelloWord.user_input.next();

to:
String test2 = HelloWorld.user_input.next();

and it should work

