[Solved] Passing String from one class to another
There are two ways: create an instance of your printer class and evoke the method on the printer object: public class MyPrinter { public void printString( String string ) { System.out.println( string ); } } in your main: MyPrinter myPrinter = new MyPrinter(); myPrinter.printString( input ); or 2. you create a static method in your … Read more