How to input 2 numbers to the program?

Dear all,
I am learning converting from http://java.sun.com/docs/books/tutorial/java/data/converting.html. I use netbean, and I copy and paste the code from the web. I choose "run file" in netbean. I know I need to input two numbers to run this program, However, I don't know how to do it in netbean
Moreover, what exactly "public static void main(String[] args) " mean? especially (String[] args)
* Main.java
* Created on June 14, 2007, 10:50 AM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package converting;
* @author Marco
public class Main {
    /** Creates a new instance of Main */
    public Main() {
     * @param args the command line arguments
    public static void main(String[] args) {
        // TODO code application logic here
            if (args.length == 2) {
               //convert strings to numbers
            float a = (Float.valueOf(args[0]) ).floatValue(); 
            float b = (Float.valueOf(args[1]) ).floatValue();
            //do some arithmetic
            System.out.println("a + b = " + (a + b) );
            System.out.println("a - b = " + (a - b) );
            System.out.println("a * b = " + (a * b) );
            System.out.println("a / b = " + (a / b) );
            System.out.println("a % b = " + (a % b) );
        } else {
           System.out.println("This program requires two command-line arguments.");

args[] is a String array so when you do:
// calling MyClass with 3 parameters
java MyClass arg1 arg2 arg3you can retreive the parameters with for loop
if(args.length < 3){
  System.out.println("use: java [options] <yourClass> param1 param2 param3");
  System.exit(0);
}else{
  for(String str:args){
    System.out.println(str);
...

Similar Messages

  • How to process a batch input session directly from the program

    Hi,
    I have developed a program which will create a batch input session.
    When the program is executed, the session should get processed . ie. the user need not have to go to sm35 to process the session. I am facing some problem in this.
    I am using BDC_INSERT by passing the tcode . The session is getting processed, but when i go to sm35, i noticed that the session is still listed under the "New" tab instead of the "Processed" tab.
    Also I am not getting the final window with the buttons " Session overview" and "Exit Batch Input".
    Please help me out in this.

    Hi
    U have to submit the program RSBDCSUB:
    SUBMIT RSBDCSUB WITH MAPPE = <session>
                    WITH VON   = SY-DATUM
                    WITH BIS   = SY-DATUM
                    WITH FEHLER = ' '
                        EXPORTING LIST TO MEMORY
                                        AND RETURN.
    Max

  • Since 2012 I have Photoshop Elements always worked without any problem, however now the language is suddenly German how can this be changed, removed the program and re-installed, not working. Program is downloaded and updated via the apple app store?

    Since 2012 I have Photoshop Elements always worked without any problem, however now the language is suddenly German how can this be changed, removed the program and re-installed, not working. Program is downloaded and updated via the apple app store?

    I've done some research on the SQLite database. Whenever Aperture hangs up (like during auto-stack or opening the filter hud) there are thousands of SQLite queries happening. These SQLite queries cause massive file I/O because the database is stored on the disk as 1kb pages. However, the OS is caching the database file; mine's only 12MB. I'm trying to track down some performance numbers for SQLite on osx but having trouble.
    It's starting to look like most of the speed problems are in the libraries that Aperture uses instead of the actual Aperture code. Of course, that doesn't completely let the developers off the hook since they choose to use them in the first place.
    Oh, and if anyone is curious, the database is completely open to queries using the command line sqlite3 tool. Here's the language reference http://www.sqlite.org/lang.html
    Hmm, just found this. Looks like someone else has been playing around in the db http://www.majid.info/mylos/stories/2005/12/01/apertureInternals.html
    Dual 1.8 G5   Mac OS X (10.4.3)   1GB RAM, Sony Artisan Monitor, Sony HC-1 HD Camera

  • How to show Indian numbers in the Firefox ?

    How to show Indian numbers in the Firefox ?
    Like This : http://i52.tinypic.com/f1y3c5.png
    Not Like This : http://oi52.tinypic.com/23r0osm.jpg

    Thank you very much ..

  • I have the new version of iMovie, and when i try to start the program, i can't because it says that it is looking for some movie files from the Iphoto, so all the program is locked up... how can i do to restart the program??

    i have the new version of iMovie, and when i try to start the program, i can't because it says that it is looking for some movie files from the Iphoto, so all the program is locked up... how can i do to restart the program??

    Hi
    Did You ever use - iPhoto ?
    Did You may be direct iPhoto to a different Photo Library
    As iMovie tries to find the appropriate photo library - it can get lost if iPhoto direct it into a Library on a not connected external hard disk or to a strange location - And iMovie HANGS.
    Do - When no other program is running that might interfere
    • Start iPhoto - BUT NOW KEEP alt-key (option key) DOWN during the full Start-Up process
    • Now iPhoto let's You select Photo Library
    • Select the one in Your Account / Home folder / Pictures ! !
    • Then iPhoto should start up OK
    • Now Quit iPhoto
    • START iMovie
    Does it still hangs - then I would suspect - iMovie Pref. file
    If it Run's OK - Then HURRAY !
    Yours Bengt W

  • How to trigger an event in the program

    Hi,
    I have a program. The purpose of the program is to retrieve the data matching the selection criteria and downlod the same to a file.
    In the selection screen, I have a parameter called 'EVENT'. Here, user enters some event name. Generally, they enter the 'Background job processing events'.
    So, my requirement is... once the files are successfully downloaded, the program should trigger the 'EVENT' specified in the selection screen at run time.
    Can someone help me in this regard. How to trigger an EVENT in the program. Is there any Function Module or Method available in SAP which triggers the EVENT at runtime.
    And is there any table available in SAP which stores all the events available in SAP. Because, whenever the user enters an EVENT in the selection screen, we should check whether the event is valid or not. So, if there is any table available which has all the events then, it will be easy I guess. or is there any other way to validate the EVENT name.
    Please help me. Thanks in advance,
    Best Regards,
    Paddu.

    Hello Paddu,
    have a look at tables
    - btcsev, btcsed (system events)
    - btcuev, btcued (user events)
    and use function BP_EVENT_RAISE.
    kind regards
    Walter Habich

  • Mac, have just upgraded to Yosemite and when I shall open Photoshop (CS4), the following message appears: "The licensing of the product does not work" Fault 6 How should I proceed? Have the program installed on only one computer.

    Mac, have just upgraded to Yosemite and when I shall open Photoshop (CS4), the following message appears:
    "The licensing of the product does not work"
    Fault 6
    How should I proceed?
    Have the program installed on only one computer.

    Download the Adobe Licensing Repair Tool.
    Run the License Service Update.
    Mac OS X 10.7 and above:
    a. Double-click the LicenseRecovery111.dmg   It will extract the folder. Open the folder.
    b. Double-click your Hard Drive.
    c. Double-click Applications.
    d. Double-click Utilities.
    e. Double-click Terminal.
    f. Type sudo python
    Note: There is a space following “python”. Do not press Return.
    g. Drag LicenseRecover.py from the LicenseRecovery111 folder onto the Terminal Window and press Return.
    It should look like this:
    h. Enter your administrator user name and password when prompted and click OK.
    (Note: the cursor will not move and you will not see stars or dots, just enter your password anyway.
    i. Let the script run, it will tell you when it is finished. Quit terminal and restart Photoshop
    Gene

  • I have Acrobat XI on a PC and have received a Fatal Error message indicating that "Acrobat failed to connect to a DDE Server."  Acrobat will not open now.  How do I regain access to the program?

    I have Acrobat XI on PC.  After trying to convert a webpage to PDF, I received a Fatal Error message indicating that "Acrobat failed to connect to a DDE Server."  Now, the program will not open.  How do I regain access to the program?

    I have Acrobat XI Pro and have been experiencing all sorts of "freeze ups" with it ever since Adobe released the new Acrobat DC the other week.  I see that an automatic update was pushed down to my Acrobat XI Pro at the same time.  Is this the first issue you have encountered with your Acrobat XI, or have you been having other issues suddenly as well??  Just wondering ...

  • Please tell me how to create a slider in the program Adobe Edge Reflow?

    Please tell me how to create a slider in the program Adobe Edge Reflow?

    There is no way to add animations in Reflow. If you want to add animation, then you can either use Muse which has many slider plugins to choose form or use the exported Reflow code in Brackets and add JavaScript for animating images there using various jquery plugins http://www.jssor.com/

  • How do I disable Numbers as the default spreadsheet application?

    A couple of days ago I was opening a Microsoft Office Excel spreadsheet, as usual. Unexpectedly, the Numbers application launched without prompting, presented an introductory page (Welcome to Numbers etc.) then asked a question (which I unfortunately don't recall). I clicked on the button that seemed to lead me out of the program, but it did not. Instead, Numbers made itself the default spreadsheet application. I cannot find a way to "undefault" it. I know how to use "Open with" in the menu and can select xlsx of course, but when I try to download new spreadsheets they automatically download as Numbers spreadsheets. I don't want to disable the Numbers application completely, but I also don't want to learn a brand new application with all its ins and outs right now. I just want to get my work done in EXCEL!!!

    Anne,
    In Finder, navigate to one of your Excel documents. Select the Excel document, but don't open it. Then choose File > Get Info from the Finder menu line.
    In the Info pane, about half way down, in Open With:, select Excel and then click the Change All... button.
    Jerry

  • Is there any way to turn off recalculation in Numbers? (The program is far too slow!)

    Hi there,
    I'm finding that Numbers is really (really!) bogging down because I have a large number of smaller tables (approx. 20) that I'm trying to link to a main spreadsheet. I've read online that Numbers will slow down because it recalculates all of the data every time you change a cell value. I really need to be able to use the system I've spent tons of time setting up, and the last step is to extract info from the individual data tables and have it display in the main spreadsheet. Can anybody help me figure out how to make this work?! Right now, there's no way I can complete the linking, as there's at least a 3-5 second lag/pause every time I try to enter a new cell value (and often, it's much longer!).
    Thanks so much!

    Barry wrote:
    One very efficient brake of numbers is the use of multiple footer rows. You may be able to obtain a noticeable speed-up with a redesign of your document to eliminate as many footer rows as possible.
    Given my experience, the most efficient brakes are column headers, the infamous columns A, B, C, D and E when they are defined as headers.
    An efficient way to fasten a document is to move tables doing only calculations in a sheet different than the one in which we insert datas.
    Using this tip with scripts, when it may apply, often divide the task duration by ten (yes, by ten).
    Yvan KOENIG (VALLAURIS, France) lundi 4 juillet 2011 22:36:56 iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How to get consecutive numbering at the end of paragraphs?

    In a big text some paragraphs, already styled, need a consecutive numbering.
    At the beginning of the paragraph the numbering will create a mess.
    Tried with fake footnotes: Impossible. The text has footnotes and converting the faked ones to text is not available.
    Tried a nice script written by Jong to add/subtract a number on numbered items, but it is restricted to index situations.
    O R I G I N A L                                   R E Q U I R E D
    a. Many years ago.                    a. Many years ago. [1]
    Lucy Smith                              Lucy Smith
    b. Margaret run away.               b. Margaret run away. [2]

    Hi, Camilo:
    First of all,  I was not thinking clearly when I blamed ID for a cross-reference bug. It was my error. Cross-references within a document need to be updated by the author, using the Update cross-references button at the bottom of the Hyperlinks & Cross-References panel, when they're moved or their source content changes. I was thinking about the known issues with cross-references that go between ID document files, which update automatically - performance slows, and sometimes they cause crashes.
    Here's the replacement reply for my previous post #1:
    camilo umaña wrote:
    In a big text some paragraphs, already styled, need a consecutive numbering.
    At the beginning of the paragraph the numbering will create a mess.
    Tried with fake footnotes: Impossible. The text has footnotes and converting the faked ones to text is not available.
    Tried a nice script written by Jong to add/subtract a number on numbered items, but it is restricted to index situations.
    O R I G I N A L                                   R E Q U I R E D
    a. Many years ago.                    a. Many years ago. [1]
    Lucy Smith                              Lucy Smith
    b. Margaret run away.               b. Margaret run away. [2]
    It's not clear if the right-hand numbers are supposed to replace the left-hand numbers while keeping the same sequence, or if you want to retain the left-hand numbers. You can use cross-references to create right-hand numbers from the paragraphs auto-numbers.
    Insert a cross-reference to the paragraph at the end of the text, with a format that captures its autonumber, and adds any ornamentation, like the square brackets in your example.
    If the rightmost number must be positioned at the right margin of the numbered paragraph, no matter how long or short it is, or if it wraps around to new lines, add a right-aligned tab stop to the paragraph style, positioned at the location where you want the number to appear, and insert a tab character in the paragraph before the cross-reference.
    If the left hand numbers are supposed to go away, you can't change the paragraph style to a non-autonumbered style, because you need the numbers that the cross-references capture. So, you need to create a character style that's very small and uses Paper for the text color, to hide the autonumbers. If the smallest point size (IIRC, it's 2 points) leaves too much space at the left of the autonumber, you might be able to reduce it further by using a small value in the Horizontal Scale property of the Advanced Character Formats in the Character Style dialog box. Your example seems to show that the numbered paragraphs are indented, so the space occupied by the hidden autonumbers may not be a problem.
    If the paragraphs are rearranged in sequence, you'll need to use the Update Cross-References button at the bottom of the Hyperlinks & Cross-References panel to update the affected cross-references.
    I'm still not clear about numbers at the end of the paragraphs in square brackets. Are they supposed to be the same value as the auto-number at the beginning of the paragraph, except that they use a numeric display format instead of an alphabetic format?
    I don't know of any code that can work with a find/replace action that can capture a paragraph's autonumber and display it at a specific location. As you've seen, cross-references need to be inserted manually. You might post a query in the InDesign scripting forum to see if someone has figured this out. If there's no complete solution, you might want to ask about a script that searches for the ends of paragraphs of the autonumbered paragraph style and opens the Insert Cross-Reference dialog box.
    Using Quick Apply to execute the Insert Cross-References command, which opens the New Cross-References dialog box, might save some energy for doing the many manual cross-references insertions. Search Google for terms like "InDesign quick apply" without quotes. You can open Quick Apply with a keystroke shortcut - Cmd+Return on Mac. You can type abbreviated commands. I use "rt cr" without quotes for (Inse)rt cr(oss-reference). Opening Quick Apply repeats the last command that was entered.
    Also, if you haven't tried a Google search for phrases like "InDesign numbered list at right end of paragraph," without quotes, give it a try. There are lots of links, including one to this forum article. Perhaps there's a golden nugget among them.
    If you think it's important for ID to be able to place autonumbers at the ends of paragraphs, please post a formal feature request here: Wishform Eventually, some user originated feature requests are incorporated in future ID releases.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • How can I make Numbers respect the row and column locks in an Excel workbook opened in Numbers???

    I have a Windows server app that generates Excel workbooks to be emailed to political campaign volunteers to be loaded into Numbers on an iPad, edited, then emailed back to be posted to the server database.  There are two problems encountered:
    1.  The Excel workbook has the first row (column headings) and first column (route identifier) of cells locked, so that they will not scroll off the screen, but Numbers doesn't respect the locks, so when the user scrolls horizontally or vertically, the column headings and/or the route identifier scroll off the screen.
    2.  The Excel workbook has pop-up "tool-tip" type comments in certain column headings in order to provide the user with the acceptable entries for those columns, but Numbers does not respect those.  When the user touches any of the commented column heading cells, a context menu appears instead of the comment.
    What must I do in the Excel workbook sheets, or what settings can be made in Numbers to correct the above?

    I imported a Numbers '09 file into Numbers on the iPad.  All comments were removed during import. Frozen header row and column were retained.
    Thank you for your responses I must ask, however, when you refer to "importing" the Excel file, are you referring to a two step process whereby the Excel file is first converted by some other process into Numbers format, then opened in the Numbers application - which is what I have to do in my PC application to generate the Excel file, and reverse that process to convert the Excel back into my database format - or are you simply referring to opening the file in Numbers as "importing" it?  And please excuse any ignorance, as I'm not at all familiar with Apple's terminologies.  In fact, I don't own an iPad myself, but rather I have to depend on one of my clients to do the testing for me.
    I imported an XLSX file into Numbers on the iPad.  The file used "freeze panes" to "freeze" the first column and row. Only warning on import was that it changed fonts. It imported without the first row and column frozen and with no comments. Nothing I can do about the missing comments but it was a simple matter to turn the first column & row into headers and freeze them.
    Unfortunately this would not be an efficient  solution, since the end users are, for the most part, elderly political campaign volunteers who are fairly computer illiterate.  These workbooks are actually canvassing lists - known as walklists.  Their purpose is for the volunteers to interview voters, record the results of the interviews, and post the results to a database, which provides the campaigns with valuable strategizing capabilities.  Also, these workbooks have multiple pages - as many as 10 or more.  and from what I infer from the above, the setting changes would have to be made on each page.
    My whole intent in developing this iPad/Tablet methodology was to significantly reduce volunteer's work - which is a recruitment benefit - and eliminate paper.  While the latter would be accomplished, the former would not, and in fact would tend to increase it.  It's necessary to keep the first row - column headings - and the first column - the route identifier - from scrolling off the page, so that the volunteer won't have to keep scrolling up and down and right and left to know what the data are.
    Conclusion: Comments are not supported on the iPad version of Numbers.  Frozen headers are not imported from Excel but can be recreated easily.
    I was previously directed to the Apple website  http://www.apple.com/ipad/from-the-app-store/apps-by-apple/numbers.html which extols the wonders of the Numbers application.  About halfway down the page there's a section regarding, "Sliders steppers and pop-ups".  The web page states that pop-ups can be set up but, being a marketing site, gives no indication whatsoever as to how it's done.  I was hoping someone could tell my if there's any way to carry them over from an Excel file.

  • How do i edit numbers in the recent call list?

    I'm using iOS 5.0.1 on the 4s currently
    Can anyone tell me how to edit the contact numbers in the recent call list? Eg. I would need to add a certain prefix in front of the number to return an overseas call in my recent call list. I tried to copy n paste the number after adding the prefix manually via keypad, but this method erases the prefix. Is there any other way to do this besides saving a different number in my contact list?

    As it happens, I use my "Recent Applications" menu as a list of "favourite" apps more than as a way to access recent apps. I won't go into too many details of "why", but I do have the "Finder" in there.
    I am using "Panther" so I don't know if this still works, but try opening "/Applications" > "Utilities" > "Terminal.app" and entering this command:<pre>defaults write com.apple.recentitems apps -array-add '/System/Library/CoreServices/Finder.app'</pre>It may be necessary to log out and back in again for the change to take effect, or the change at least may only be active in apps launched after modification of the file. There may also be issues related to the number of items in the list - it may be necessary to increase the "Number of recent Applications" through "System Preferences", or else clearing the list before entering the above command.
    I also keep my "com.apple.recentitems.plist" file "locked" - this prevents items from being dropped through non-use. Despite being "locked", the menu does update during a login session so I still get some "recent item" functionality from the menu. Everything does of course revert to the saved state for the next login, however.
    Regarding the "Dock", in "Panther", after "hiding" the "Dock", it is relatively easy to "pause" or restart it, repectively, using:<pre>killall -STOP Dock
    killall -CONT Dock</pre>Perhaps these commands could be incorporated into an "AppleScript" application and added to "Recent Applications". However, you will also lose the use of ⌘-Tab application switching, Exposé, widgets, and the ability to minimize windows while the "Dock" is paused. Alternatively, there are a number of preference settings that can be applied to the Dock's ".plist" file to minimize its obtrusiveness without affecting other "Dock.app" functions. However, it will be more difficult to toggle between the two states than simply pausing the whole app...

  • How does one skip numbering on the first page?

    When I was in school I was able to produce sets of documents which were automatically numbered in the header, but the 1 on page 1 was not shown. I don't remember it being a pain in the *** to set up, but I'll be damned if I can figure out how to do it now...???

    Go to Document,
    then Section,
    then in Headers and Footers
    you should see option to Hide on first page of section

Maybe you are looking for

  • How to add additional lines to the Order Form template?

    I purchased and installed Acrobat Pro 9 because of its ability to create forms and found the Order Form template is just perfect for what I need, why reinvent the wheel, right?   Except I found I can't figure out how to add additional object that dup

  • Lync 2013 for Android problem

    Hi, We've got a problem with Lync 2013 client for andriod unable to connect to our on prem Lync 2013 deployment. Windows Phone clients can connect without any problems, Lync diagnostic tool doesn't throw any significant errors, PC clients are working

  • How do I uninstall apple mobile device

    UNINSTALL APPLE MOBILE DEVICE

  • Partila Payment and Residual Payment,

    Hi, From my understanding is this applicable for both inocming and outgoing payments, How will we determine whether this is partial for residual payments. Please help me in understanding the concept. Thanks

  • Upgrade Photoshop from CS2 to CS3 in Macintosh

    I am currently using Photoshop CS2 Mac version and DO NOT have CS3 beta version installed. I have couple installation questions whose answers are hard to find anywhere else, hope I can find them from this forum. Since I heard a lot of troubles regard