Gokul Raam wrote:
there are C1 and C2 clasees and I have Main class and from Main class i need to call C1 and C2 in order to run continuously.
The problem is that both C1 and C2 have different program arguments which are mentioned in run configurations of eclipse and in Main class if i use the below method to call those C1 and C2 classes I will error.
C1.main(args);
C2.main(args);
So Now i need to get those program arguments in code and i need to call those C1 and C2 classes like
args1 = "Program arguments of C1 class"
args2 = "Program arguments of C2 class"
C1.main(args1);
C2.main(args2);
So, what's stopping you? Clearly you know how to call C1 with one set of args, and C2 with another set of args. If you're asking where to get those args from, there's no way anybody here can know that. Only you know what those args are supposed to be and where they're coming from.
If you're asking how to get them from "configurations of eclipse", then that can be found in the eclipse docs, or eclipse tutorial, or eclipse forum. But basically, there will be somewhere in eclipse where you can tell it what args to pass when you start your main program, so you just need to fill that in with something like
and then your Main has to parse those out to figure out which args go with each C1 and C2. Maybe there are a known, fixed number for each, so that, for example, args[0]-args[2] go to C1 and args[3]-args[5] go to C2. Or maybe you provide a special delimiter, such as "--" or ":::" or something, and when Main sees that, it knows everything before it is for C1 and everything after is for C2.