if wanted to make a this method print using zero pad how do you do so
int month, day;
public void printNumeric()
{
System.out.printf("month +"/" +day +" \n");
// i would like the month if it is 5 to be 05 same thing with the day
}
int month, day;
public void printNumeric()
{
System.out.printf("%02d/%02d\n", month, day);
// i would like the month if it is 5 to be 05 same thing with the day
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With