Code example for Scanner

Methods: nextInt, useLocale

0
        } 
 
        s = new Scanner("03456");
        assertEquals(3456, s.nextInt(10));
 
        s = new Scanner("\u06603,456");
        s.useLocale(Locale.ENGLISH);
        assertEquals(3456, s.nextInt(10));
 
        s = new Scanner("E3456");
        assertEquals(930902, s.nextInt(16));
        // The following test case fails on RI, because RI does not support 
        // letter as leading digit 
        s = new Scanner("E3,456");
        s.useLocale(Locale.ENGLISH);
        assertEquals(930902, s.nextInt(16));
 
        /* 
         * There are 3 types of zero digit in all locales, '0' '\u0966' '\u0e50' 
         * respectively, but they are not differentiated. 
         */