| | |
how to modify the code to Creating multiple instances of a Class <<Very basic>>
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Apr 2008
Posts: 102
Reputation:
Solved Threads: 2
The code found below takes command lines arguiments and displays. I want to modify this code in anyway that it would take 2 set of command line arguiments and produces 2 outputs. (That means , Open 2 command prompts and run the code)
ex: first cmd prmpt -> java CmdLnArgmntExp abc
2nd --> java CmdLnArgmntExp def
*in brief --> how to modify the code to Creating multiple instances of Class CmdLnArgmntExp
ex: first cmd prmpt -> java CmdLnArgmntExp abc
2nd --> java CmdLnArgmntExp def
*in brief --> how to modify the code to Creating multiple instances of Class CmdLnArgmntExp
Java Syntax (Toggle Plain Text)
public class CmdLnArgmntExp { public static void main(String[] args) { System.out.println("d"); for (int i = 0; i < args.length; i++) System.out.println(args[i]); } }
Local P ...
•
•
Join Date: Jan 2008
Posts: 3,829
Reputation:
Solved Threads: 501
Re: how to modify the code to Creating multiple instances of a Class <<Very basic>>
0
#2 Jun 22nd, 2009
•
•
•
•
The code found below takes command lines arguiments and displays. I want to modify this code in anyway that it would take 2 set of command line arguiments and produces 2 outputs. (That means , Open 2 command prompts and run the code)
ex: first cmd prmpt -> java CmdLnArgmntExp abc
2nd --> java CmdLnArgmntExp def
*in brief --> how to modify the code to Creating multiple instances of Class CmdLnArgmntExp
Java Syntax (Toggle Plain Text)
public class CmdLnArgmntExp { public static void main(String[] args) { System.out.println("d"); for (int i = 0; i < args.length; i++) System.out.println(args[i]); } }
Right now you don't have ANY instances of CmdLnArgmntExp, much less multiple instances. Everything is in main and you have no constructor.
By "open 2 command prompts", do you mean you want two separate console windows? And who/what is opening them? You, a human being, or the program?
![]() |
Similar Threads
- Modify code created with Dreamweaver CS3, to compare two text feilds. (JavaScript / DHTML / AJAX)
- running multiple instances of a same perl-cgi script (Perl)
- Creating an Object in Project1 from a Class in Project2 (Visual Basic 4 / 5 / 6)
- accessing parent of a class (C++)
- How do I get classes within a class??? (C++)
- Creating Multiple Bitmaps win32 (C++)
- Squid multiple instances log problem (*nix Software)
- urgent: modify code please (C)
- Count Instances (Java)
- Does this really generate multiple instances of a UNIX process (Perl)
Other Threads in the Java Forum
- Previous Thread: Help me!!!!
- Next Thread: Why??
| Thread Tools | Search this Thread |
2dgraphics account android api apple applet application array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class classes client code component data database derby design draw eclipse encryption error event exception fractal game givemetehcodez graphics gui html ide if_statement image inheritance input integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel jtextfield julia linux list loop map method methods midlethttpconnection mobile monitoring netbeans newbie nullpointerexception open-source oracle print printing problem program programming project property recursion reference ria scanner screen search server set size sms sort sourcelabs splash sql static stop string swing testautomation threads time tree ui unicode validation windows






