[問題] 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