0
   public static void main(String[] args) throws ParseException, UnsupportedEncodingException {
    int rishav = 42;
    System.out.println(rishav);
}

this gives 42, but the below gives 34 :-

public static void main(String[] args) throws ParseException, UnsupportedEncodingException {
    int rishav =0042;
    System.out.println(rishav);
}

If I need to transform an integer to trim its leading zeros, what do I do, most feasible.

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
91StarSky
  • 482
  • 3
  • 10

0 Answers0