Code example for Scanner

Methods: toString

0
 
    /** 
     * @tests java.util.Scanner#toString() 
     */ 
    public void test_toString() { 
        s = new Scanner("test");
        assertNotNull(s.toString());
    } 
 
    /** 
     * @tests java.util.Scanner#nextLine() 
     */ 
    public void test_nextLine() { 
        s = new Scanner("");
        s.close();
        try { 
            s.nextLine();
            fail("Should throw IllegalStateException");
        } catch (IllegalStateException e) {
            // expected