Learning objectives
Use the static Math methods abs, pow, sqrt and random, which need no import because they belong to java.lang, and state the type each one returns
Write expressions combining Math.random, arithmetic and a cast that produce a random int or double in a stated range, with each end inclusive or exclusive as required
Create String objects from literals and with the String constructor, join Strings with + and +=, and predict the result when a primitive value, or another object through its toString method, is joined to a String
Use length, substring, indexOf, equals and compareTo with zero-based indexing, including s.substring(i, i + 1) to take a single character, and state what indexOf and compareTo return
Identify the index values that make a String method throw an index-out-of-bounds exception, and explain why a String is immutable, so that no method call changes the original object
Trace a call made on the value returned by another call, such as substring combined with indexOf, recording the value produced at each step
Continue with a revision plan
These learning objectives are available to everyone. Sign in with an eligible plan to read the full note and worked examples.
