[问题] Thinking in Java 4th 的一个范例

楼主: lordfish62 (阿瑜)   2014-07-21 20:24:57
完整程式码如下:
import java.nio.*;
import java.util.*;
public class RandomWords implements Readable
{
private static Random rand = new Random(47);
private static final char[] capitals =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
private static final char[] lowers =
"abcdefghijklmnopqrstuvwxyz".toCharArray();
private static final char[] vowels =
"aeiou".toCharArray();
private int count;
public RandomWords(int count) { this.count = count; }
public int read(CharBuffer cb)
{
if(count
作者: pzyc79   2014-07-21 20:35:00
s.next() -> n = source.read(buf); source就是RandomWord
楼主: lordfish62 (阿瑜)   2014-07-22 00:46:00
感谢,我去找code来看

Links booklink

Contact Us: admin [ a t ] ucptt.com