package info.kalendra.guiceExample; import com.google.inject.Guice; import com.google.inject.Injector; public class GuiceExample { /** * @param args */ public static void main(String[] args) { /* * Guice.createInjector() takes your Modules, and returns a new Injector * instance. Most applications will call this method exactly once, in their * main() method. */ Injector injector = Guice.createInjector(new TestModule()); /* * Now that we've got the injector, we can build objects. */ //PrintTest tester= injector.getInstance(PrintTest.class); //tester.print("check"); PrintTestFactory tester= injector.getInstance(PrintTestFactory.class); tester.create(5,6).print("wow"); tester.create2(23).print("Really?"); } }