I have the following problem. I wrote a project that contains a class and methods in it. I have exported the project to the jar because I want to use it as a library in another project. Is it possible to call the method without the declaration of the object?
public class Client {
public static void init(String host) {
init(host, 123);
}
public static void init(String host, int port) {
ClientAgent clientAgent = new ClientAgent();
clientAgent.connect(new InetSocketAddress(host, port));
} }
What do I have to do to call the init method from the library in this way:
init("1231",124)
instead of
Client.init("1231",124) or new Client.init("1231",124)
when I importing
import... Client; or import ...Client.init; called method init(..,..) doesn't work.