Printf function? If you see such an article, close it and continue Google.

Source: Internet
Author: User

Brother is not a computer professional, so he was poisoned by the printf function in the past. The first is hard to find, and the second is useless. He just output a printf. What is the purpose of programming? Do you think you are playing the Overlord game machine?

When I saw the printf book, I threw it away, so as not to crack your determination to enter the programming world.

I will close the article below.

Http://blog.csdn.net/ocean20/article/details/6277668

Goolge wants this, which is closer to the real world.

Method 1

Import java. Text. decimalformat;

Decimalformat df = new decimalformat ("000 ");
Print (DF. Format (1) + ". jpg ")

Method 2

S = string. Format ("% 05d", 123); // "00123"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.