Is it possible to store 0001 in int?

java

Solution

if you know how much digits number have you can use

String.format("%04d", number); 

int will allways return 1

Problem

The product (25 years old product) I am working on is very large and complicated. So let me explain what I want in simple scenario: I've declared an `int` variable. Say, `int var = 0001;` When we try to retrieve the value of `var`, we'll get `1`. Now, my requirement is, is it possible to return `0001`, without changing the signature or return type of the method?

Original source