Math methods
String class
s1. equals( “hi”)
s1. substring(5)
s1. substring( 2,7)
s1. charAt(3)
s1. indexOf(“a”)
Scanner methods
next( ) nextInt( ): when working with an integer nextDouble( ): when working with a double nextLine( ) hasNext( )
The next() and hasNext() methods and their primitive-type companion methods (such as nextInt() and hasNextInt()) first skip any input that matches the delimiter pattern, and then attempt to return the next token. Both hasNext and next methods may block waiting for further input. Whether a hasNext method blocks has no connection to whether or not its associated next method will block.
while loop
A while loop is a control structure that allows you to repeat a task a certain number of times.
do…while loop
A do…while loop is similar to a while loop, except that a do…while loop is guaranteed to execute at least one time.
for Loop
A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.
A for loop is useful when you know how many times a task is to be repeated.