Schreiben Sie eine Ableitung Random2 der Standardklasse Random. Random2 soll Random um
die folgenden Methoden ergänzen.
- nextByte()
Returns the next pseudorandom byte value from this random number generator's sequence.
- nextByte(byte b)
Returns a pseudorandom byte value between 0 (inclusive) and the specified value (exclusive),
drawn from this random number generator's sequence.
- nextShort()
Returns the next pseudorandom short value from this random number generator's sequence.
- nextShort(short s)
Returns a pseudorandom short value between 0 (inclusive) and the specified value (exclusive),
drawn from this random number generator's sequence.
- nextLong(long lo)
Returns a pseudorandom long value between 0 (inclusive) and the specified value (exclusive),
drawn from this random number generator's sequence.
- nextChar()
Returns a pseudorandom char value between 'a' (inclusive) and 'z' (inclusive),
drawn from this random number generator's sequence.
Die Klasse Random2 soll außerdem die gleichen Konstruktoren anbieten wie Random.