idk if the title fits the problem and please change if it's not matching the problem.
But i wanted to know if there is a convenient way to generate multiple Things. I implemented my Things as basic Java classes with a constructor where i pass the path of config-file and generate the object. So i created a Main class which looks like:
public class Main {
public static void main(String[] args) {
new MyThingService("src/main/resources/thing.conf");
new MyThing("src/main/resources/ammeter.conf");
new MyThing("src/main/resources/bla.conf");
}
}
The first object of MyThing gets constructed and exposed, the second one not. If i create a second class with a main method:
public class SecMain {
public static void main(String[] args) {
new MyThing("src/main/resources/bla.conf");
}
}
it works...
Is it possible to create multiple things (of one class) in one main?
Hey guys,
idk if the title fits the problem and please change if it's not matching the problem.
But i wanted to know if there is a convenient way to generate multiple Things. I implemented my Things as basic Java classes with a constructor where i pass the path of config-file and generate the object. So i created a Main class which looks like:
The first object of MyThing gets constructed and exposed, the second one not. If i create a second class with a main method:
it works... Is it possible to create multiple things (of one class) in one main?
Kind regards,
Phil