What is the use of passing String[] args in main() method?

what is the use of passing String[] args in main() method?
Is there any specific use for this ?

actually my sir asked me the same question & I gave
the same reply as given by you........but he further
asked what is the use of this also??
ie accepting cmd line args at runtime??is there any
specific purpose ??Apart from the one you just mentioned? No

Similar Messages

  • What is the use of passing object reference to itself ?

    What is the use of passing object reference to itself ?
    regards,
    namanc

    There is an use for returning an object reference from itself, for instance:
    class C {
    public:
         C append(C c) {
             // do something interesting here, and then:
             return this;
    }You can "chain" calls, like this:
    C c = new C();
    C d = new C();
    C e = new C();
    c.append (d).append (e);Maybe the OP has "inverted" the common usage, or thought about a static method of a class C that requires a parameter of type C (effectively being a sort of "non-static method").
    class C {
        static void doAnotherThing (C c) {
            c.doSomething(); //-- effectively C.doAnotherThing(c) is an "alternative syntax" for c.doSomething()

  • What is the use of search String?

    Hello there, I am trying to find the use of search string (DE01 and DE02). thanks.

    Hi,
    In your system DE01 and DE02 might be something configured for your client.
    Please check the below link to understand the logic of your search strings:-
    [http://help.sap.com/saphelp_erp2004/helpdata/en/43/0bd87b43de11d1896f0000e8322d00/frameset.htm]
    Regards,
    Gaurav

  • What is the use of Generic class in java

    hi everyone,
    i want to know that
    what is the use of Generic class in java ?
    regards,
    dhruvang

    Simplistically...
    A method is a block of code that makes some Objects in the block of code abstract (those abstract Objects are the parameters of the method). This allows us to reuse the method passing in different Objects (arguments) each time.
    In a similar way, Generics allows us to take a Class and make some of the types in the class abstract. (These types are the type parameters of the class). This allows us to reuse the class, passing in different types each time we use it.
    We write type parameters (when we declare) and type arguments (when we use) inside < >.
    For example the List class has a Type Parameter which makes the type of the things in the list become abstract.
    A List<String> is a list of Strings, it has a method "void add(String)" and a method "String get(int)".
    A List<File> is a list of Files, it has a method "void add(File)" and a method "File get(int)".
    List is just one class (interface actually but don't worry about that), but we can specify different type arguments which means the methods use this abstract type rather than a fixed concrete type in their declarations.
    Why?
    You spend a little more effort describing your types (List<String> instead of just List), and as a benefit, you, and anyone else who reads your code, and the compiler (which also reads your code) know more accurately the types of things. Because more detail is known, the compiler is able to tell you when you screw up (as opposed to finding out at runtime). And people understand your code better.
    Once you get used to them, its a bit like the difference between black and white TV, and colour TV. When you see code that doesn't specify the type parameters, you just get the feeling that you are missing out on something. When I see an API with List as a return type or argument type, I think "List of what?". When I see List<String>, I know much more about that parameter or return type.
    Bruce

  • Please what does 'String[] args' in main is set to in a normal no parameter

    Please,
    what does 'String[] args' in main is set to in a normal no parameters static main function??
    I have a frame with a static main function in it, in the main i want to do one thing if the function got parameters and another if it didnt.
    if i check for (if (args[0] == "Load") i get an exception
    and args is not null, i know, how do i know if the array has parameters??
    p.s
    I new to java

    Yes, like jsalonen said.
    And args[0]=="Load" won't work, you have to use
    args[0].equals("Load");

  • What's the Use

    What's the Use of "columns" in SWINGJTEXTFIELD

    SwingTextField {
    columns: 14 //**AM ASK ABOUT THIS FIELD .ANY ONE KNOW**
    height:500
    text: " "
    editable: true
    background:Color.RED
    selectOnFocus:true
    verify:function (arg:String):Boolean{          
    var val:String="Rams";
    if(arg.equals(val)){
    return true;
    else {
    return false;
    }

  • What is the use of COL_SELECT_MASK IN fm gui_download?

    Hi i Just want to know what is the use of col_select_mask in GUI_DOWNLOAD.
    currently i need to work on one report where they are passing this parameter to gui_download.
    result is it is taking only 255 char column length in the downloaded excel...
    i need to add extra fields to the downloaded excel..but it is taking only 255 how to over come this issue?
    i tried commented the COL_SELECT_MASK but it is taking unnecessary fields in the internal table i dont know how come they are excluding some fields without downloading ?Any one any idea?
    Regards
    sas  .

    Well thanks for the information.
    Now i understood that
    in itab there are 10 fields where user wants to see in the excel only 8 fields.
    so they use col_mask parameter what ever columns we pass only those o/p we can see in the output.
    so now that col_mask need to increase to few more fields in result which the size of excel is more than 255 char which in result need to display 8 + my 6 fileds = 14 fields.
    due to over size it is displaying only 10 fields. Rest 4 are missing.
    so using COL_MASK is there any way to define more than 255 char column length?
    Regards
    sas....
    DiD you check the FM where it is written as if col_sel = 'X'.
    COL_SLE_MASK = 'xxx'.
    then it will download 1 , 3 5 columns???/
    what is this i dont understand???
    Regards
    sas

  • What is the use of REUSE_ALV_FIELDCATALOG_MERGE

    Hi
    in alv's what is the use of REUSE_ALV_FIELDCATALOG_MERGE OTHER THAN ADDING FIELD HEADINGS
    Title Edited by: Alvaro Tejada Galindo on Jan 11, 2008 4:20 PM

    Hi,
    This is the functionality of that FM,
    Supports the creation of the field catalog for the ALV function modules
    based either on a structure or table defined in the ABAP Data
    Dictionary, or a program-internal table.
    The program-internal table must either be in a TOP Include or its
    Include must be specified explicitly in the interface.
    The variant based on a program-internal table should only be used for
    rapid prototyping since the following restrictions apply:
    o   Performance is affected since the code of the table definition must
        always be read and interpreted at runtime.
    o   Dictionary references are only considered if the keywords LIKE or
        INCLUDE STRUCTURE (not TYPE) are used.
    If the field catalog contains more than 90 fields, the first 90 fields
    are output in the list by default whereas the remaining fields are only
    available in the field selection.
    If the field catalog is passed with values, they are merged with the
    'automatically' found information.
    reward points if useful,
    seshu.

  • What is the use of read_text in scripts?

    hi
    what is the use of read_text in scripts?

    HI,
    in genral read_text FM is used to display the Text maintained in standardtransactions like ME21n/ va01 ,,, if u wanna display this text, u shud use READ_TEXT by passing th erelavnt parametsr like object, id, text, lang.
    in case o f scripts, there is no need to call this FM, when u r including the standard text using menu--include -standard text, here u shud give the object, id, text, lang..(this is simialr to standard text) then script will display the text mainatined in the standard transactions.
    Regards,
    Naveen

  • What is the use of CTU_PRAMS in bdc programming?

    what is the use of CTU_PRAMS in bdc programming?
    can any explain wit a sample code.

    Hi,
    Hi,
    If u write table control bdc program in 14'' monitor screen, then if the same program u run at different monitor size, then the screen resolution problem comes in to the picture,
    like, u get 5 records in table control in one screen, and some other records in other screen, to avoid this screen resolution problem we use CTU-PARAMS Structure.
    In ur program u have to set
    defsize type ctu_params-defsize value 'X',
    Then u will be free of screen resolution problem.
    Fill the str CTU_PARAMS-defsize = 'X' and pass in CTU stmnt as
    call transaction 'XXX' options using t_bdcdata ctu_params.
    Analysing :
    1. If nothing works, then we have to
    some ifs & buts.
    2. There shall be normally
    2-4 different kinds of resolution
    on various users comptuers.
    3. Based on this,
    we have to know beforehand,
    what will be the number of rows
    in the table control.
    4. The user can be given
    a selection/paraemter
    for resolution
    eg. 800x600
    1024x100
    axb
    etc.
    5. Based on this, we will hardcode
    in the program (based upon our knowledge/recording
    which we have seen and done)
    we will hardcode
    the number of lines
    in the VARIBLE.
    6. Then we can simply use this variable
    for our LOOP and logic purpose.
    7. It will be the responsibiltiy of the
    use to CHOOSE THE CORRECT resolution,
    on the selection-screen.
    For screen resolution use ctu_params, with default size
    Data : f_option type ctu_params,
    f_option-updmode = 'S'.
    f_option-defsize = 'X'.
    f_option-dismode = 'N'.
    call transaction 'VA01' using bdcdata options from f_option messages into bdcerror.
    CALL TRANSACTION tcode... OPTIONS FROM opt
    ... OPTIONS FROM opt
    Effect
    Allows you to control processing using the values of the componetns of the structure opt, which must have the ABAP Dictionary type CTU_PARAMS. The components have the following meanings:
    DISMODE
    Display mode (like the MODE addition)
    UPDMODE
    Update mode (like the UPDATE addition)
    CATTMODE
    CATT mode (controls a CATT)
    CATT mode can have the following values:
    ' ' No CATT active
    'N' CATT without single-screen control
    'A' CATT with single-screen control
    DEFSIZE
    Use default window size
    RACOMMIT
    Do not end transaction at COMMIT WORK
    NOBINPT
    No batch input mode (that is, SY-BINPT = SPACE)
    NOBIEND
    No batch input mode after the end of BDC data.
    The components DEFSIZE , RACOMMIT, NOBINPT, and NOBIEND always take the following values:
    'X' Yes
    ' ' No
    If you do not use the OPTIONS FROM addition, the following control parameter settings apply:
    DISMODE
    From addition MODE
    UPDMODE
    From addition UPDATE
    CATTMODE
    No CATT active
    DEFSIZE
    Do not use default window size
    RACOMMIT
    Successful end on COMMIT WORK
    NOBINPT
    Batch input mode active ( SY-BINPT = X
    NOBIEND
    Batch input mode remains active after the BDC data

  • What is the use of FOLDER NODE in SMARTFORMS?

    what is the use of FOLDER NODE in SMARTFORMS?
    please explain.

    Hi,
    By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    How to create a New smartfrom, it is having step by step procedure
    http://sap.niraj.tripod.com/id67.html
    Here is the procedure
    1. Create a new smartforms
    Transaction code SMARTFORMS
    Create new smartforms call ZSMART
    2. Define looping process for internal table
    Pages and windows
    First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
    Here, you can specify your title and page numbering
    &SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
    Main windows -> TABLE -> DATA
    In the Loop section, tick Internal table and fill in
    ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
    3. Define table in smartforms
    Global settings :
    Form interface
    Variable name Type assignment Reference type
    ITAB1 TYPE Table Structure
    Global definitions
    Variable name Type assignment Reference type
    ITAB2 TYPE Table Structure
    4. To display the data in the form
    Make used of the Table Painter and declare the Line Type in Tabstrips Table
    e.g. HD_GEN for printing header details,
    IT_GEN for printing data details.
    You have to specify the Line Type in your Text elements in the Tabstrips Output options.
    Tick the New Line and specify the Line Type for outputting the data.
    Declare your output fields in Text elements
    Tabstrips - Output Options
    For different fonts use this Style : IDWTCERTSTYLE
    For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5.
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Reward all helpfull answers
    Regards
    Omkar

  • What is the use of jsp when compare with Struts

    what is the use of jsp when compare with Struts

    JSP Tag Libraries are great for reusable content formatting and ligic.
    For example, let's say you have this Shopping site. Each item you sell is stored in a database, and you get them out depending on Catagories, creating a List of ItemBeans. You allways want to display the items with a catagory header, then a <table> with the item number, the description and the price.
    Instead of creating a bunch of logic in the JSP that does this, you can pass it on to a Tag that might look like this in your JSP:
    <shopping:itemTable catagory="${selectedCatagory}" items="${itemsForCatagory}" />
    This would make the JSP easier to read and work with.
    The actual uses are incredible. Have you used the <jsp:useBean ...> tag? That is an example of a use of the Custom Tag Libraries.
    Furthermore, look into JSTL (JSP Standard Tag Libraries). They are a collection of tags (API by Sun, coding by Apache) used to do many of the standard actions you might want/need to do in JSPs, like a conditional tag (c:if only do something if the test is true), multiple-conditional tags (c:choos c:when c:otherwise) like an if [else if] else construct. Looping through an array or Collection (c:forEach), storeing values in scopes (c:set) formating numbers and dates (the fmt library), xml transformations (xml library), and lots of other things that you could replace scriptlet code with.

  • What is the use of the setter dependency injection in Spring?

    What is the use of the dependency setter injection ?
    In a database driven app, I retrieve results, use the javabeans set methods to save stuff in javabeans and then call get on it.
    What is the use of having something set externally from a xml already ?
    Can someone provide an example when the setter injection can be used?
    I wouldnt imaginge using it to get usernames, passwords, databaseurl because we use JNDI for that...
    Is the dependency setter meant as something additional to web.xml so you dont have to get params from web.xml?

    No, you would indicate in the XML that the Hibernate object and the TransactionFactory (I am being vague here) have a dependency. You then specify whether you want setter or constructor injection. When Spring creates the Hibernate Object, it will attempt to also create a TransactionFactory and pass that to the Hibernate Object's setter. "Auto-wiring" them together for you.
    - Saish

  • What is the use of class Class

    What is the use of class Class?

    Sample use: if you are specifying the name of a class in a config file, you can use Class method newInstance to instantiate it.:
    String classname = ...
    Runnable r = (Runnable) Class.forName(classname).newInstance();
    r.run();

  • What is the use of Single Sign On?

    What is the use of Single Sign On? How is it different from simple session handling.
    I am new to Portal Technology. I am not gettting the concept of Single Sign On.
    Please can anyone brief about it.
    Thanks

    SSO will store all your sessions to every applications and also it can remember your login/passwords for each application and then pass them transparently.
    In Application Server Portal is considered like a partner application and SSO is used when you connect to Portal.

Maybe you are looking for

  • Embedding HTML4 tags to Form Fields in IDM?

    Hi, I've been trying to add the <Div> tag to a SortingTable field without success, I tried inserting before a field of display class Html, but this doesn't work, I've tried other ways but it doesn't work either. Showing the result HTML code appears l

  • Downloaded Safari 4.0.3 upgrade and Safari will become unresponsive. Why??

    Periodically the new version of Safari will become unresponsive when I click on a web site. Any web site. The spinning beach ball starts and never quits. I have to force quit and start it back up again. I hope that Apple is working on a fix for this.

  • IWORKS License query

    Hi I have just upgraded to Leopard and want to buy / install IWorks. I have only the one Mac but 3 user accounts on that mac. I want to understand if I buy a SINGLE license can I install on my MAC and ALL users can use the applications or do I ahve t

  • [solved] dhcpcd problem after upgrading to 6.0.4/6.0.5

    I cant access any network after upgrading to 6.0.4 or 6.0.5. Im using the Linux-Kernel 3.10.3. Does anyone have the same problem? Downgrading to 5.6.8 solved this problem. Here is the output of dhcpcd and wpa_supplicant: dhcpcd[28734]: version 6.0.4

  • How can we Export a Flat file

    Hi Expertise          my problem is how can export a flat file to any 3rd party system ( the file may be imported or created in console ).....My problem is in Syndicator Manager how can we map the source and destination..from where we get this destin