Printf is printing twice??

Hello all, I have a problem with printf using netBeans.
Here's my code for the class that I created;
    public class Account
       private double balance;
       public Account(double initialBalance)
          balance = initialBalance;
       public double getBalance()
          return balance;
    }Here's the code for the main class;
public class Main
    public static void main(String[] args)
        Account accountOne = new Account(200.00);
        System.out.printf("The Balance of the Account is: %.2f", accountOne.getBalance());
}When I run the project, I get: "The Balance of the Account is: 200.00The Balance of the Account is: 200.00"
I wonder why I'm getting it twice.
Thank you.

When I comment out the printf, I get nothing.
And when I add \n at the end like this; System.out.printf("The Balance of the Account is: %.2f\n", accountOne.getBalance());I only get it printed once and the cursor goes to the next line.
It is not a big deal but I thought I was doing something wrong. Maybe I have to restart netBeans and try it.
Thank you.
Edited by: Roronoa.Zoro on Jun 27, 2010 2:25 PM

Similar Messages

  • In ALV Report output heading is printing twice.

    Hi Experts,
    Im working on ALV Reports.
    Im printing header text by using listheader and commentary write function module.
    the problem is when i sort any column in ALV ouput the heading is printing twice.
    Again if i sort the column the heading is printed is 4 times.
    so if anybody knows the solution how we can avoid repetition of heading ,
    Please reply me as soon as possible.
    regards
    Imrangs.

    Hi Noorie,
    Thanks a lot.
    Your answer is perfect.
    Bye.
    Regards,
    Imran

  • Dunning Letters printed twice for the each Dunning number.

    Hi,
    Dunning letters are printed twice with the same Invoice & Details and sent to the customer.
    could you please let me know why the Dunning letter has benn printed twice? We need to give change any Profile options on printer side or in Adv collections?
    Please suggest.
    Thanks & Regards,
    Bhanu prakash

    Hello Bhanu,
    Is this dunning process has customized. If this is customized please check the end to end setup.
    Regards

  • Data printed twice on the next  page in smartform

    Hi all,
    I ahve created  a smartform where I  print the header details at the start and then below that details for all line items for a particular document.
    so i have data ;ike :
    Header data :
    field 1 : field 2:
    Field3 : field4:
    field5: field6:
    Item data :
    field1 field2 field3 field4 --> Item 1
    field1 field2 field3 field4 -->Item 2
    field 1 field2 field3 field4 -->Item3
    For the Header data,I use a template in a secondary window.
    However for the item data,i use a table in MAIN window (As i know the no of records only at runtime).Also another reason for usng table would be that I dont need the header on each flloowing page but only the Line item details on the following pages.
    Now i have created a second page with only the MAIN window from the First page as I need only the  remaining line item details  to be continued/printed on the following pages.I have actually copied the MIAN WINDOW from the first page to the second page adjusting only the  uppe rand left margin.
    However now when i see the rpint preview.the 1st page data,is printed corrrectly.however on the 2nd page,the 1st record is printed twice.
    Can anyone explan why is this happening?
    Thanks!

    Thanks for the replies.
    @Meghanandan,
    I dont want to set any command for going to next page as I dont have any condition to go ot next page.Im setting the width of the first page main window to print sufficient data.
    @satyajit
    I have the text elements under the MAIN AREA.Cna you pls elborate which Points i need to check undre the table node which might have been unnnecesssarily checked?
    Thanks again for your time.

  • Duplicate entries in Table T5UGJ - Garnishment notice letters printed twice

    Hi Experts,
    We have a scenario where duplicate entries have been created for an employee in the table T5UGJ. Hence when the notice letters were printed, they printed twice.
    Would there be any specific reason or any master data change in IT 0194 / IT195 which would trigger a duplicate entry in this table?
    Any information is highly appreciated.
    Thanks,
    Dipesh.

    Hi Arti,
    Please find my responses below :
    1. The employee has two different Creditor garnishments, one dated for June and second for July.
    2. The duplicate notice letters are printed for second garnishment
    Thanks,
    Dipesh

  • Need  to show three diff sheets in a smart form , first to be printed twice

    Hi
    I need to show data in a smart form where I have 3 different sheets
    •     Process order request
    •     BoM
    •     Assembly
    where the first sheet will be printed twice .
    as header in each case we have order no , produced material order qty , qty produced etc with the title changing for each sheet . main window we have diff data depending on each form like it will b changing for process order req, bom , assembly .
    how to do that & I need to print each layout in 2 diff language.
    plz help.
    useful answers will be rewarded.
    Thanks

    Create three pages . The first and the last are static and the second variable.
    The first page repeat with a loop twice. The headers of the second pages and next has a window static (the header) and other variable .
    If you have two languages repeat the operation. Call the smartform with a parameter called language by example

  • An original document cannot be printed twice error

    Hi All,
    Here is the thing, I am on SAP B1 2007A PL 45. I have draft Incoming Payments. Now, I choose the Payment Drafts Report and from there, I click on the relevant payment draft to highlight it. Then I click Print to print a receipt for that payment.
    I choose my printer and then click on Print. The error message, "An original document cannot be printed twice. In the Print Preferences window, choose to print a single copy only." appears and nothing is printed.
    The problem is, I used to be able to do this in version 2005A PL 46. I am aware of note number 1262165 but this note is not relevant to me as I have not set for the receipt to be printed once added. Any solutions to this? Thanks.

    Gordon,
    I refer to the note and the problem is, for me, I have not added the document and in 2005A, I could print the receipt when I select the particular payment in the draft window. In 2007A now, I can't.
    In any case, I was referring to the temporary solution which was in the link posted by Jeyakanthan A above and I needed more explaination as to how to use the work around while I wait for a permanent solution in SAP.
    In any case, the note you were referring to has been fixed in Patch 48. I am now on Patch 49, so obviously my problem is not related to the note.
    Can someone please further elaborate on the temporary work around so that I can try it out? Based on the brief description, I did not understand how the temporary work around can help me.
    Anybody at all, if you could be kind enough to explain the work around, thank you very much.
    Regards,
    Alvin

  • SAPScript form printing twice

    Hi Experts,
    I have a sapscript form being used in transaction LT31. When LT31 printing is executed, the form is always being printed twice. Where should I start investigating on this?
    Thanks in advance!

    Check the variant, I guess in variant you will have an options...
    Regards,
    SaiRam

  • Same set of data should print twice on same page in SAP SCRIPT

    Hi Experts,
    I come across a requirement where I need same set of data in sap script should print twice as it is on same page.
    and if first page overflow, then same scenario should continue till complete data is printed. Basically main window data should print twice in two blocks on same page.
    E.g.
    If I have 10 line item which is to be printed on top window on  first page. Now I want that same 10 lines should be printed in a block below the first block. Data should flow similarly across multiple pages.
    Hope my question is pretty clear. I am expecting suitable answers from experts.
    Thanks in advance.
    Regards,
    Vijay

    Hi
    I had the same request for a check form in Canada. I solved it by writing the line item output into variables and print these variables in a second window. It was ~10 hours of effort, not a real nice technical solution but it worked.
    If you require I can send you a PDF of the sap script form definition. You can contact me at [email protected] Answers can take 1 week or more. 
    Best regards
    JD

  • Error printing twice

    String error_msg = (String)((DynamoHttpServletRequest)request).getObjectParameter("message");
    int msg=error_msg.indexOf("some string");
    if (msg >=0) {
         StringBuffer new_error_msg= new StringBuffer();
    ((DynamoHttpServletRequest)request).setParameter("message",new_error_msg.toString());
    else {  //when it enters this else loop, the error message is printing twice. how to restrict this
    if (error_msg.startsWith("the ShipTo me")) {
         StringBuffer new_error_msg= new StringBuffer();
    if (error_msg.indexOf("phone number") >= 0) {
    new_error_msg.append("The " + error_msg.substring(14));
    else {
              new_error_msg.append(error_msg.substring(14));
    error_msg = "The "+ new_error_msg.toString();
    ((DynamoHttpServletRequest)request).setParameter("message",error_msg.toString());
    else if (error_msg.indexOf("zip code is not valid") > -1 ) {
         ((DynamoHttpServletRequest)request).setParameter("message","Invalid Zip");
    When it enters the first else loop, error messages are printing twice. how to stop this error messages printing twice?It should print error messages once.

    I corrected the problem by doing the following:
    1. created a commit action in my ui model and renamed it to save.
    2. put a UniquePkValidationBean on my primary key so that the overridden setAttributeInternal method would throw a JboException
    Thanks,
    David

  • PO Smartform in SRM is Printing Twice

    Hi Friends,
    PO SMartform in SRM is Printing Twice.
    SAP Note 1042372 & 1099046 is already implemented
    Any body can suggest what to do..
    Regards,

    Closed

  • AP Checks printed twice on different days

    Good Morning Gurus-
    I am stumped on this one.  My client discovered that a payment run from a week before printed twice however cannot determine how when this happened.  The original payment run happened on June 13 and we believe it reprinted over the weekend or on Monday because we got another batch of same checks.  Our checks are printed offsite.
    How can I research this because I see our spool from Friday but no duplicates since.
    Thank you.
    Albert

    Hi there! I recommend reaching out directly to Spotify Support. They can be reached through their Twitter Page or through the online contact form.
    Make sure to check your inbox and junk folder for an email from Spotify. Once you get it, make sure to reply back right away, even if it says it's from a "no-reply" email.
    Cheers!

  • Filemaker Pro 5.5, with Tiger, records print twice

    I've used Filemaker since 1994, with OS and filemaker in early versions, and all was well, but suddenly, with Filemaker Pro 5.5, with Tiger, all the records print twice (a pain when hundreds of pages of labels print twice). It also happens in a test user profile, and I can't see any settings that would make it happen.

    Again may I send you to:
    http://discussions.info.apple.com/webx?14@@.68a44932
    Sue

  • My sapscript form gets printed twice in PRD.

    Hello experts,
    We are currently facing a problem here. We just transported our sapscript tp PRD yesterday and today the users complained that the printout is always printed twice. But on our testing in DEV and QAS that isn't the case. Can you please give me possible causes of this problems and suggestions. Help would be greatlt appreciated.
    Again, thanks a lot guys and have a nice day!

    Check the output condition record which is generating the output, it might have been set to issue 2 outputs (number of copies). Output condition records are not transportable and can be maintained directly in production, that gives more reason to belive that things might work different across landscape.
    If you cannot figure out where to look for and exhaused all your options, debug the print program and check what is getting pass to FM OPEN_FORM call in "Number of copies".
    Thanks,
    Shashi Reddy

  • PLD to be printed twice in same Page ........!!

    Hi Gurus,
    I have created a PLD that is working fine but I want to take print of that PLD twice in same paper (A4 Size).  Please guide if it is possible . (Though the size of PLD is not more than half of A4 size Page and we need duplicate copy of the same so its better to take a print at one time)
    With Thanks,
    SK

    hi,
    goto Administration -->> System Initialization -->> Print Preferences -->> Per Document Tab, from the dropdown list select which document you wish to print twice. from the Copies (Invl. Original) put in the textbox 2. this will print 2 copies everytime you print the document
    regards,
    Fidel

Maybe you are looking for

  • Looking for best practice on showing data inside a TableView

    I have an app, that can retrieve one ore more than 300,000 rows as the result of a query and i am displaying them into a TableView.. i am using a mechanism to bring the data "on parts", when i do the query an object with the ids of the rows is set in

  • Can you transfer files from Macbook Pro to iPad Air via USB ?

    Hi , Can you use that USB adapter to transfer photos / .pdf`s / .mp3`s and so forth ? I have a MBP-R + MM , and would like to be able to use the newer iPad Air for veiwing photos as well as .pdf`s , I got the music part , just sync with iTunes. Many

  • Combining libraries with IPhoto 9.5.1

    OK, I've been reading other older posts, so hoping someone can help me with newer versions....I have libraries from an old computer, thumbdrive, desktop, etc, some IPhoto versions are quite old...I want to combine all onto an external drive and make

  • Certain addons are appearing in spanish. How do i change language settings?

    I noticed that a few of my extensions were in spanish, specifically adblock plus and fasterfox. I just downloaded flashblock and it showed up in spanish too. I have other extensions that are showing up in english though so i'm not sure what's happeni

  • Screen saver defaults to National Geographic library

    I have a late 2013 iMac. I recently (Dec. 2014) installed the Yosemite 10.10.1. Since I have installed it my photos no longer come up on the screen saver after a logout or shut down, even though overtime I see them I choose my photo library in System