How can long lines of code be cut / separated into multiple short

In Java, How can long lines of code be cut / separated into multiple short lines?
Example
System.out.printf( "%d\t%d\t%s\t%s\t%s\t%s\t\t%s\n", arrayIndex ,  part[ arrayIndex ], name[arrayIndex], units[arrayIndex], price[arrayIndex], units[arrayIndex] * price[arrayIndex], total[ arrayIndex ]   );Thanks

System.out.printf( "%d\t%d\t%s\t%s\t%s\t%s\t\t%s\n",
arrayIndex , 
part[ arrayIndex ],
name[arrayIndex],
units[arrayIndex],
price[arrayIndex],
units[arrayIndex] * price[arrayIndex],
total[ arrayIndex ]   );P.S. It looks to me like you have an array for each attribute of something. This is not OO and you should consider creating a class holding the information about each 'Part' or whatever it is. You will then just need a collection of Parts.

Similar Messages

  • How can i transfer my code fragments from cc into cc 2014?

    Since I automated lots of frequently used code fragments in CC, I miss them a lot in the new release as they don't synchronize with other preferences and content.
    How can I prevent that many work to be lost?

    You can do this pretty easily from the desktop without needing to install any kind of extension...
    First, turn on your system's hidden folders, then...
    OS > Users > Your user name > AppData (normally hidden) > Roaming > Adobe > Dreamweaver CC > your language > Configuration
    Copy the entire Snippets folder there, then go to ...
    OS > Users > Your user name > AppData (normally hidden) > Roaming > Adobe > Dreamweaver CC 2014 > your language > Configuration
    Paste the Snippets folder
    Done.

  • How can I split up a 248 sites document into multiple 8 sites documents?

    Hi, i made an really big indesign document (248 sites, >300mb). The print guy now doesn't want that. He wants multiple 8 pages documents (yes open indesign documents - not pdf or something).
    How can I do this without messing up my whole document?
    I also have another question.. I once made a task in InCopy for testing purposes, but now i don't want it anymore. I deleted the folder where it was in, and now i keep getting an error at the start of the document that the task isn't there anymore. How can i complete delete this task out of Indesign, so that he doesn't even search for this task thing.
    Sorry for being a noob
    Thanks in advance!

    The correct answer is that you need to find a new printer, but you can use the Move Pages command in the Pages panel flyout menu to move pages in chunks of 8 into new files. Rename the A master page first to preserve it (identically named master pages and styles will be redefined to use the definitions in the receiving document), and move the pages "before" page 1 in the new file so they don't switch sides of the spread. Delete the blank page 9 after moving. You'll also need to set the start page number for each file (or you can let ID  do that by combining them into a Book (.indb) afterwards.
    This is going to destroy hyperlinks and cross-references, if you used them, the TOC or index if they need to be updated, and it's going to do bad things to threaded text across the document breaks.

  • How can i prevent itunes from splitting individual albums into multiple albums?

    How do prevent itunes from splitting albums with various artists into multiple albums? 
    Thanks for your help!

    It's probably better to put Various Artists into the Album Artist box rather than just "various". Make sure it's the Album Artist field though. In addition, you need to mark the album as a compilation. When setting the complete album, the Part of a compilation is on a drop-down menu on the File/Get Info/Options tab:
    but if changing just one song, it's a tick-box on the Info tab:
    and needless to say, the album name must be exactly the same for each track.

  • How to break down long lines of code

    Is there a way to break a long line of code so that it will fit on an A4 sheet?

    You can break on most dots between variable name and method name, between spaces in operators, after a comma that separates parameter names, etc. Just about the only thing you can't break is a long literal String--though you could type it on multiple lines by breaking it into pieces and putting a + in between the pieces.

  • How can I get refund codes back after deleting the e-mail?

    A mistake by iTunes had me purchase Taylor Swift's Red album for full price even though I had previously purchased a few singles. iTunes sent me an e-mail with some refund codes, but I can no longer locate the e-mail. I looked on my account under "Gifts" but they are not there. How can I retrieve these codes?
    Thank you!!

    You'll have to contact the iTunes Store again and ask if they can resend.
    Regards.

  • How can I get the code of a Custom Module?

    Hi guys.
    I'm in a new client, and they have a problem in one of their interfaces. The PI version is 7.1.
    The interface uses the Mail Adapter, and there is a Custom Module there. The company that did this module is no longer in this client, and they did´nt leave any document about this module.
    So, how can I find the code of this Module?
    Regards,
    Eric Freitas

    Hello,
    Check Vadim's reply
    Checking code in custom adapter module
    Thanks
    Amit Srivastava

  • How can i check if a Final Cut Studio licence has been used or not?

    Hello there,
    How can i check if my 'Final Cut Studio 3 Retail' set has a usuable licence or they have been used allready? It is second hand and i no longer have a Mac and wish to sell the product. In the box it has 2 of the same serials so i gather it can be used twice?
    Any help would greatly be appreciated
    Kind Regards
    Tim

    If your serial is printed on the official sticker you will have no problems and should the new owner register it, any previous registrations will be deleted.
    Officially you can only use it on one Desktop and one Laptop but there is no physical limit to the number of computers you can install it on.

  • How can i improve this code ?

    DATA: t_bkpf TYPE bkpf.
    DATA: t_bseg type bseg_t.
    DATA: wa_bseg like line of t_bseg.
    select * from bkpf into t_bkpf where document type ='KZ' and bldat in s_bldat.
    select single * from bseg into wa_bseg where belnr = t_bkpf-belnr.
    append wa_bseg to t_bseg.
    endselect.
    loop at t_bseg into wa_bseg.
      at new belnr.
         if wa_bseg-koart EQ 'K'.
            // pick vendor wrbtr
         else
           // pick other line item's wrbtr
         endif.
      endat.
    endloop.
    i am guessing my select statements arnt efficient performance wise, secondly in the loop when i use  'at new belnr' it aint showing my any values  whereas i get all the vendors(KOART EQ 'K') when i dont use 'at new belnr' .
    why is this so and how can i make the code efficient ?
    Thanks..
    Shehryar

    Hi,
    1.Dont read all the fields from the table unless it is required in your program.
    This will tremendously improve your performance.
    2.Make use of the key fields of the table wherever possible
    In your scenario you could use the fields BUKRS,BELNR,GJAHR of the table BKPF in the WHERE Clause rather than
    other fields.This will improve your performance a lot..
    3.As BSEG is a cluster table it will cause performance problem in most cases.So try to read
    the required fields from it rather than reading all the fields.Again Make use of the key fields in the WHERE Clause
    here too to improve the performance..
    4.Remove SELECT..ENDSELECT and replace it with FOR ALL ENTRIES to improve the performance.
    Cheers,
    Abdul Hakim
    Mark all useful answers..

  • How can i rewrite this code into java?

    How can i rewrite this code into a java that has a return value?
    this code is written in vb6
    Private Function IsOdd(pintNumberIn) As Boolean
        If (pintNumberIn Mod 2) = 0 Then
            IsOdd = False
        Else
            IsOdd = True
        End If
    End Function   
    Private Sub cmdTryIt_Click()
              Dim intNumIn  As Integer
              Dim blnNumIsOdd     As Boolean
              intNumIn = Val(InputBox("Enter a number:", "IsOdd Test"))
              blnNumIsOdd = IsOdd(intNumIn)
              If blnNumIsOdd Then
           Print "The number that you entered is odd."
        Else
           Print "The number that you entered is not odd."
        End If
    End Sub

    873221 wrote:
    I'm sorry I'am New to Java.Are you new to communication? You don't have to know anything at all about Java to know that "I have an error," doesn't say anything useful.
    I'm just trying to get you to think about what your post actually says, and what others will take from it.
    what does this error mean? what code should i replace and add? thanks for all response
    C:\EvenOdd.java:31: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=true;
    ^
    C:\EvenOdd.java:35: isOdd(int) in EvenOdd cannot be applied to ()
    isOdd()=false;
    ^
    2 errors
    Telling you "what code to change it to" will not help you at all. You need to learn Java, read the error message, and think about what it says.
    It's telling you exactly what is wrong. At line 31 of EvenOdd.java, you're calling isOdd(), with no arguments, but the isOdd() method requires an int argument. If you stop ant think about it, that should make perfect sense. How can you ask "is it odd?" without specifying what "it" is?
    So what is this all about? Is this homework? You googled for even odd, found a solution in some other language, and now you're just trying to translate it to Java rather than actually learning Java well enough to simply write this trivial code yourself?

  • Just got an ipad air and while creating my apple ID with credit card, I got to itunes gift card/ itunes gift section and was asked to supply a CODE to proceed with the form but I don't have the code. please how how can i get the code?

    Just got an ipad air and why creating my apple ID with credit card, a CODE was requested in the itunes gift card/ itunes gift in order to preceed with the form but I don't have the code. Please how can I find the code so as to enable me complete the form successfully. Thanks alot

    The iTunes gift card field is optional, you don't have to fill it in - leave it blank if you don't have a gift card.
    iTunes gift cards are country-specific (they can only be used in their country of issue), and they are not available in all countries - so you might not be able to dill it anyway.

  • How can I limit numeric codes in a text field?

    How can I limit numeric codes in a text field? For example I want to list Industry SIC codes and I want to block someone from inputting an exlcuded industry code.

    We don't offer that type of input restriction for a text field. 
    Can you create a list of all allowed codes and use a Drop Down menu or Single/multiple Choice field? 
    Thanks,
    Josh

  • How can I resolve error code -54 in iTunes? I am using the latest iTunes. No new updates are available.

    How can I resolve error code -54 in iTunes? I am using the latest iTunes. No new updates are available. I'm using iTunes 11.3 on a MacBook Pro, OS X 10.6.8. I can't save my library in iTunes, the message just keeps popping up.

    From an OS9 reference, error -54 is a software lock on a file or a permissions error. (Although there is no formal list of OSX error code some of the old codes still apply to OSX .)
    First, try simply restarting your computer.
    Try quitting iTunes, then deleting the .xml (not .itl !) version of the library file in the iTunes folder (iTunes will generate a new one).
    iTunes Library cannot be saved (Error -54) - https://discussions.apple.com/thread/1912814 - various things to try.
    Unknown error (-54) while syncing ipod - https://discussions.apple.com/thread/1082953 - problem was locked files
    Why does iTunes keep showing a -54 error when I sync my iPad? - https://discussions.apple.com/thread/3727114
    Error -54 possibly related to Touch Copy - https://discussions.apple.com/thread/3727114 - cleared by deleting preferences on iPad.
    iTunes: Missing folder or incorrect permissions may prevent authorization - http://support.apple.com/kb/ts1277
    Troubleshooting permissions issues in Mac OS X - http://support.apple.com/kb/HT2963

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • How can we put program code which looks similar to SAP Program in SAP ?

    when we copy the code and paste here in this editor, the setup of all the code becomes disturbed and we may not able to understand, plz suggest how can we post the code which is actully looks similar in SAP abap program ?
    Thanks & Regards,
    Amit
    Edited by: akg.amit on Oct 20, 2010 8:35 AM

    Hi Amit,
    Check this thread.
    How to post code in SCN, and some things NOT to do...
    Regards,
    Immanuel.

Maybe you are looking for