|
|
![]() |
| Thread Tools | Search this Thread |
#1
| |||
| |||
How to pass arguments to the main method How to pass arguments to the main method, What is the meaning of supplying string[] args to main method? Is there any different thing that we need to consider while passing arguments to the main method. |
#2
| |||
| |||
Re: How to pass arguments to the main method In C#, value types (like int, double, byte and structs) are passed by value, by default. This means that the receiving method has a NEW instance of the type. Select Run menu, Click Open Debug Dialog, Click Arguments tab and give your arguments there. If an int that has a value of 1 is passed to the method, and the method changes it to 2, this change is only reflected within the method, the calling location's int is still 1. |
#3
| |||
| |||
Re: How to pass arguments to the main method In C#, value types (like int, double, byte and structs) are passed by value, by default. This means that the receiving method has a NEW instance of the type. Select Run menu, Click Open Debug Dialog, Click Arguments tab and give your arguments there. If an int that has a value of 1 is passed to the method, and the method changes it to 2, this change is only reflected within the method, the calling location's int is still 1. |
#4
| |||
| |||
Re: How to pass arguments to the main method Your questions isn't clear, but I'd like to point out that in C#, objects are passed by reference by default. Once you compile your new class, with the main() method that you want, you can add it to the jar file -- this is done by extracting the jar, adding your class, and recreating the jar fileMeaning, if you have an object, and then pass that object on to a method that makes changes to that object, those changes will affect the object in your calling code as well, since they both reference the same object. |
![]() |
|
Tags: main method, pass argument, programing language, string argument |
Thread Tools | Search this Thread |
|
![]() | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
what are the possible return types of a main method? | \"Dritan\" | Software Development | 3 | 08-01-2011 03:50 AM |
Explain main method in java | Angelica Maria | Software Development | 5 | 10-03-2010 01:18 PM |
String in the method arguments | DANIEL 602 | Software Development | 3 | 29-12-2009 02:21 PM |
Variable method arguments in Csharp | KAMANA | Software Development | 3 | 14-11-2009 05:57 PM |
How to pass runtime arguments to JAVA Application | Nihar Khan | Software Development | 2 | 30-03-2009 01:37 PM |