Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: The printf() method explanation needed

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Thanked 0 Times in 0 Posts

    Default The printf() method explanation needed

    Could anyone give some info on the printf() method..
    I know we can put %d and %s in the format argument so that it takes a string data type
    and a decimal data type but apart from that are there any other uses of printf()?

    some simple examples will do the job i guess..

  2. #2
    Junior Member
    Join Date
    Mar 2010
    Thanked 1 Time in 1 Post

    Default Re: The printf() method explanation needed

    I think it's the only reason you use the printf() method.
    In other methods like print or println it just only print the thing in the computer screen but you can't format the output.
    but with the pritnf you can format it.. like the thing you want to printout can be formatted to two decimal like that..
    Other than that i think it's the only reason you use this printf();

Similar Threads

  1. help needed
    By The Lost Plot in forum Loops & Control Statements
    Replies: 4
    Last Post: March 16th, 2010, 03:55 AM
  2. Test and Set Explanation
    By bananasplitkids in forum Algorithms & Recursion
    Replies: 2
    Last Post: March 6th, 2010, 01:10 PM
  3. [SOLVED] Help needed!
    By subhvi in forum Web Frameworks
    Replies: 4
    Last Post: February 18th, 2010, 09:26 AM
  4. [SOLVED] A little help needed..
    By JavaStudent87 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: January 22nd, 2010, 06:54 PM
  5. Explanation on Arrays NEEDED
    By lamagiapc in forum Collections and Generics
    Replies: 4
    Last Post: November 7th, 2009, 11:36 PM