Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Formatting Integer Display in Java

  • 07-01-2007 05:39PM
    #1
    Closed Accounts Posts: 636 ✭✭✭


    Ok. How do I set format an integer so that it prints out a certain amount of numbers. There is no code for this really but I'll try somthing.


    public class x{
    public static void main(String args[])
    {
    int x;
    x=7;
    System.out.println(x);
    }
    }


    So this will print "7" to the screen. What I want to know is how do I print "07" to the screen?
    __________________


Comments

Advertisement