|
||
|
|||
|
If I were to take in more than one flag from the command line, such as "java myProgram -a -b -c Hey" and each flag prompted an alteration of the word "Hey", how would I go about doing that? I tried using if-else statements but was only able to get one flag recognized at a time.
If this thread should be moved, feel free to do so, I wasn't sure what forum to put it under.
|
|
|||
|
The loop that helloWorld922 posted above is showing u how to get all the parameters from the command line. If you want to specify some action for some specific parameter that user will enter then you can use if statements to alter each one. You can even use a switch statement. Just play a bit with your code and i'm sure that you will understand it better.
And once you did you will not forget, something like riding a bicycle
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing Information between classes | SKhoujinian91 | Object Oriented Programming | 4 | 08-12-2009 07:40 PM |
| what if flag? | chronoz13 | Java Theory & Questions | 8 | 08-11-2009 04:44 AM |
| Passing objects as a constructor parameter | derky | Object Oriented Programming | 2 | 27-10-2009 08:31 AM |
|
100 most searched terms
Search Cloud
|
| 2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java addactionlistener addactionlistener java convert double to integer java double format java double to integer in java double to integer java drag en drop programmeren java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double in java format double java get mouse position java java 2d arraylist java actionlistener java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java programming practice problems java send keystrokes to another application java two dimensional arraylist java.io.ioexception: premature eof java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton action jbutton actionlistener jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics smack api two dimensional arraylist two dimensional arraylist java unable to sendviapost to url what is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? |