How can i take input from user?

class input{
public static void main(String args[]){
int i,j,result;
//i want to take input here from user.
result=i+j;
System.out.println(result);
}

here's the code which takes input of i , j from user and adds it
<code>
public static void main(String[] args)
          int i=0;
          int j=0;
          String s = null;
          System.out.println("Enter value of 'i'");
          InputStreamReader isr = new InputStreamReader ( System.in );
          BufferedReader br = new BufferedReader ( isr );
          try
          s = br.readLine ();
          i=Integer.parseInt(s);
          System.out.println("Enter value of 'j'");
          isr = new InputStreamReader ( System.in );
          br = new BufferedReader ( isr );
          s = br.readLine ();
          j=Integer.parseInt(s);
          System.out.println("Enter value of 'i+j ='"+(i+j));
          catch(Exception e){}
</code>

Similar Messages

  • How can i get input from user in Workflows

    Hello professionals,
    I'm new to SAP B1 Workflow, i have created some workflows and they all worked fine.
    But, I am wondering, How can i get input from user?. For example, i want to display list of options to choose between them and route the workflow based on the selected option. I don't want to use the exclusive gateway and check for some conditions, i want to get input from user.
    How can i do that?
    Thanks in advance,
    Kareem Naguib

    Hi,
    Please refer SAP help file:
    http://help.sap.com/saphelp_sbo900/helpdata/en/b8/1f9a1197214254b79bcf8f93f9fff9/content.htm?frameset=/en/44/c4c1cd7ca22…
    Thanks & Regards,
    Nagarajan

  • Lost home PC with my iTunes account on it in a home fire.  How can I take everything from my iPhone 4 and put it on my new PC?

    Lost home PC with my iTunes account on it in a small home fire.  How can I take everything from my iPhone 4 and put it on my new PC?  Is this even possible?  iPhone 4 / new PC running Win XP Pro.  I have backed up to iCloud recently so the info is out there, just need to bring it down onto my PC....
    Need HELP.............

    Copy from iPod to computer
    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities
    The sync to iPhone
    iTunes: Syncing media content to iOS devices and iPod

  • Since the iPod Lightning connection is not supported, how can you take videos from your iPod 5th Gen to your tv?

    Since the iPod Lightning connection is not supported, how can you take videos from your iPod 5th Gen to your tv?

    Lightning TV out
    - Via Airplay to an Apple TV.
    or one of these cables.
    - http://store.apple.com/us/product/MD826ZM/A/lightning-digital-av-adapter?fnode=3 a
    - http://store.apple.com/us/product/MD825ZM/A/lightning-to-vga-adapter?fnode=3a

  • How can I take minutes from mysql date format

    how can I take minutes from mysql date format??
    example 10:30:00 is stored in my sql and I want to create 3 variables which will store hours, minutes and seconds..
    Cheers..

    "use application date format" is the choice you want.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • How can I take pictures from my Iphone and upload them in my computer ?

    How can I take pictures from my Iphone and upload them in my computer ?

    iOS: Importing personal photos and videos from iOS devices to your computer

  • How can i take music from my iphone an add it to my mac

    How can I take the music from my iphone or someone elses an add it to my mac?

    "How can I take the music from my iphone"
    The sync is one way - computer to iphone.  The only exception is itunes purchases.  File:Devices>Transfer Purchases
    "or someone elses "
    Not legal.

  • How can I take music from an USB and transfer it to the iPod? It tells me use use itunes to sync but the music is on an USB drive. It had worked in the past. Tks

    How can I transfer music from an USB drive to the iPod. I can see the music and play it on the computer, but the iPod tells me to use iTunes to sync. The music is not on iTunes. It has worked in the past.....tks

    These are just playlists. The songs there are really not duplicates of the songs. They are just a different location for accessing them. Some playlists can be deleted, some cannot. Ones that are created by iTunes cannot be deleted. Ones that you create can be. The Recently Added and the 90's cannot.

  • How to create a dialog that takes inputs from user!!!!!!

    hi there
    anyone has any idea about creating a dialog that takes user input? some thing like login GUI. thank you. it would be better if you can provide some sample codes.

    The Java Swing tutorial has a section on creating dialogs. There is a demo on how to get user input from a dialog:
    http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html#input
    The entire tutorial can be downloaded from:
    http://java.sun.com/docs/books/tutorial/

  • How can I take text from a webpage that is in multiple rows and move it into a single row in Excel?

    I need help figuring out how to take data from internet pages and enter it into one single row in an excel, or numbers if that is the easier way to go.  I was also told access might be good to use.  Basically I am going to chamber of commerce page and wanting to extract the member listing and enter in a database in a single line.  The  data is in different numbers of lines as you will see below (info edited to take out personal info). So I want to take the  name of business, business owner, address, city, state, zip, and phone and put it into one line on a spreadsheet.  I want to do this many times over. I think there is a way to do it through apple script and automator, but I have not been successful after 2 weeks of trying and searching.  I have over 800 listings and I surely don't want to go through and do them one at a time.  Any suggestions?
    Data from website:
    Westrock Coffee
    Mr.
    Collins Industrial Place
    North Little Rock, AR 72113
    Phone:
    Send Email
    Member Since: 2011
    Sweet Creations by DJ
    Ms. J
    allace Bridge Road
    Perryville, AR 72126
    Phone:
    Fax:
    Send Email
    Member Since: 2013
    See Also Woman Owned and/or CEO
    Premium Refreshment Service
    Mr. E
    est Bethany Road
    North , AR 72117
    I want it to look like this
    Company name, owner name, address, city, state, zip, phone
    How can I get the extra data out of the way and remove the format so that it will go into excel?  Thanks for any help you can provide.  I am not to savvy with code, but I got a friend who is an IT guy that can help.  Thanks again

    So, basically, create 800 individual entries, each one containing everything from business name through the phone (not fax) number, add some commas and spaces to entries, and then put each entry on a separate line?
    1. Go to website page such as this one-- http://www.littlerockchamber.com/CWT/External/WCPages/WCDirectory/Directory.aspx ?ACTION=newmembers --which seems formatwise very close to what you're trying to scrape.
    2. Cmd-A to select all. Cmd-C to copy it to clipboard.
    3. Open freeware TextWrangler. Cmd-V to paste info from clipboard into a blank TW document.
    4. Remove lines from top and bottom so that only membership list remains.
    5. Process lines to remove everything from "Fax" line through "See Also" line. Only business name through phone number will remain in the file.
    --A. TW > Text > Process Lines containing . . .
    -----(check "Delete matched lines"; uncheck all others)
    -----Enter "Send Email" in the search box.
    -----Click Process.
    --B. Repeat 5A for other lines to be removed
    ------Member Since
    ------See Also
    ------Fax
    6. Insert markers to separate entries:
    TW: Search > Find . . .
    ------(check "Wrap around" and "Grep")
    ------in Find box: \r\r\r\r
    ------in replace box: \r***
    ------Click Replace All
    7. Remove remaining blank lines:
    TW: Search > Find . . .
    ------(check "Wrap around" and "Grep")
    ------in Find box: \r\r
    ------in replace box: \r
    ------Click Replace All
    8. Add comma and space at end of each line:
    TW: Search > Find . . .
    ------(check "Wrap around" and "Grep")
    ------in Find box: $
    ------in replace box: ,  (comma space)
    ------Click Replace All
    9. Remove all returns:
    TW: Search > Find . . .
    ------(check "Wrap around" and "Grep")
    ------in Find box: \r
    ------in replace box: (leave blank)
    ------Click Replace All
    10. Insert returns in place of markers:
    TW: Search > Find . . .
    ------(check "Wrap around" and "Grep")
    ------in Find box: \*\*\*,  (backslash asterisk backslash asterisk backslash asterisk comma space)
    ------in replace box: \r
    ------Click Replace All
    11. Remove trailing comma and blank on each line:
    TW: Search > Find . . .
    ------(check "Wrap around" and "Grep")
    ------in Find box: , $ (comma space dollar sign)
    ------in replace box: (leave blank)
    ------Click Replace All
    Import this text file into Excel or Numbers.

  • How do i get input from user?

    For example if i wanted to ask "Whats your favorite number" and then get the input from the user and assign it to a variable how would i go about doing that?
    Any help would appreciated

    hope this helps
    import java.io.*;
    public static void main(String[] args)
      //this is the important part
      BufferedReader in = new BufferedReader( new InputStreamReader(System.in) );
      String response = "";
      System.out.println("What is your favorite color?");
      try{
           //now read the line
           response = in.readLine();
      }catch(Exception e){
            //enter error code here
      System.out.println("I like " +response+ " as well!");
    }

  • HT1296 How can I take photos from my computer and send it to my ipad

    How can I transfer my photos from my computer which is in my photo library on my Dell to my new IPAD? I have an app called Sky Drive but no help I have iCloud also. Can someone please help me or do I have to sit and send one photo at a time from my computer to my new 3rd generation IPAD. Please Help. Thank You Michelle Elia Mistye1945  

    Another way. You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov; DSCN0164.jpg).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import. (You can not export using the camera connection kit.)
    Secrets of the iPad Camera Connection Kit
    http://howto.cnet.com/8301-11310_39-57401068-285/secrets-of-the-ipad-camera-conn ection-kit/
     Cheers, Tom

  • How can i get input from microphone?

    Hi,
    I am trying to create a program that essentially tries to detect the
    Microphone . Pls tell how can i perform this. Any suggestions, pls?

    http://www.bulletsandbones.com/GB/GBFAQ.html#midionreal

  • How can I take data from specific column in a table using VBA

    Hi
    I do not know how to take the values from the last column in a table, I know how to look over each row but I cannot take the last column values for each row I pass by.
    This is the table for example:
    | Date | Account1 | Account2 | Description | Amount |
    |12/03/2008 | 123-32 | 325-78 | None | $50 |
    |12/03/2008 | 123-32 | 325-78 | None | $20 |
    |12/03/2008 | 123-32 | 325-78 | None | $10 |
    |12/03/2008 | 123-32 | 325-78 | None | $40 |
    I am using this code as a reference that User FiveNines gave me to loop through all the rows in the table, so What I need is to take the values of the column Amount for each row I go through.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    For Each tblRow In tbl.rows
    If tblRow.innerText = strValue Then
    RSWApp.WriteToLog "Tables", "Passed", "Row is Present", True
    End If
    Next
    End Sub

    Hi Lippix.
    This is code that will loop the rows then loop the cells and check for "$" which will return dollar values. I also attached a script.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    For Each tblRow In tbl.rows
      For Each tblCell In tblRow.cells
      ' cycle through the cells and only report those with a dollar value by searching for $
        If InStr(1, tblCell.innerText, "$") <> 0 Then
       RSWApp.WriteToLog tblCell.innerText
       End If
      Next
    Next
    End Sub

  • How can I take data from multiple pages documents and put them into a numbers table?

    I produce invoices in pages, with dates, invoice numbers, references and amounts due. I want to take all this data from multiple documents and transfeer it to a single numbers table. Is this possible and if so, how do I do it. I know I can do it the other way round with mail merge but I can't figure out how to do it this way round?
    Thanks,
    Keith

    The data is spread throughout a pages document in specific areas here's a copy of an invoice for you to have a look at.

Maybe you are looking for

  • Using insert command in NVL function

    How can we use insert command in a NVL function exapmle : INSERT INTO employee VALUES ( (NVL ( (SELECT emp_id FROM employee WHERE emp_name LIKE 'Test'), (insert into employee values((select max(emp_id)+1 from employee),'Test'))))); I mean i will chec

  • Using m4a files with window moviemaker

    i'm new to itunes. I'm trying to use m4a audio files with windows moviemaker but could not. is there a way to change file ext or to download in mp3 form? thanks

  • ITunes deleted my apps during sync

    I looked up other people's problems but nothing that I saw quite matched what I was exaclty looking for. I plugged my iPhone into my Mac and noticed my Apps haven't been updating. So I went in to sync my apps with my iTunes library. It said I had app

  • LMS communication error in Citrix environment

    I've recently deployed a module created with Captivate 8 into Kallidus LMS and am finding a number of users are receiving the LMS communication error when they attempt to launch the module: I've tested the module on our test and production sites, as

  • OS X 10.6.8 Disk Utility Issue

    I am running OS X 10.6.8 Through disk utility, I have been informed that the hard disk needs to be repaired by booting from my OS X disk, and running the utility. The problem is I can't find my disk. Any other solutions?