Code example for Scanner

Methods: locale

0
 
    /** 
     * @tests java.util.Scanner#locale() 
     */ 
    public void test_locale() { 
        s = new Scanner("test");
        assertEquals(Locale.getDefault(), s.locale());
    } 
 
    /** 
     * @tests java.util.Scanner#useLocale(Locale) 
     */ 
    public void test_useLocale_LLocale() { 
        s = new Scanner("test");
        try { 
            s.useLocale(null);
            fail("Should throw NullPointerException");
        } catch (NullPointerException e) {
            // expected 
        }