Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Formatting Integer Display in Java

Options
  • 07-01-2007 5: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