| | |
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,836
Reputation:
Solved Threads: 503
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 |
Tag cloud for Java
addressbook android api apple applet application arguments array arrays automation binary bluetooth button calculator chat class classes client code columns component converter database draw eclipse error errors event exception fractal ftp game givemetehcodez graphics gridlayout gui html ide image inetaddress input integer j2me japplet java javaprojects jme jmf jni jpanel jtextarea julia link linux list loop map method methods midlethttpconnection mobile netbeans newbie number objects openjavafx oracle php print problem program programming project projects recursion rim scanner screen server set signing size smart sms socket sort sortedmaps sql storm string support swing test threads time tree unlimited variablebinding webservices windows






