Code example for Console

Methods: format

0
        console.flush();
        assertFalse(console.writer().checkError());
    } 
 
    public void test_format_LString_LObject() { 
        assertSame(console, console.format("%d %s", 1, "hello"));
        String prompt = new String(((ByteArrayOutputStream)out).toByteArray());
        assertEquals("1 hello", prompt);
    } 
 
    public void test_printf_LString_LObject() { 
        Calendar c = new GregorianCalendar(1983, 2, 21);
        assertSame(console, console.printf("%1$tm %1$te,%1$tY", c));
        String prompt = new String(((ByteArrayOutputStream)out).toByteArray());
        assertEquals("03 21,1983", prompt);
    } 
 
    public void test_reader() throws IOException { 
        Reader reader1 = console.reader();
        assertTrue(reader1.ready());
Contextual code suggestions in your IDE  Get Codota for Java