Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {
    public static void main(String[] args) {
        int number = 1500;

        String formatted = String.format("%07d", number);

        System.out.println("Number with leading zeros: " + formatted);
    }
}