Chapter 03 Summary

Methods with parameters

Creating methods:

public static return_type method_name (type parm1, type parm2)
{
...
...
return expression;
}

Calling methods:

object_or_class.method_name(parm1, parm2);

You need the class or object if the method is not in your own class. Then, you need the object if the method needs to know some information that is not passed in.

Math

Creating and using objects like Point

Strings

ex: newString = myOriginalString.toLowerCase();

Also, strings can be put together into another string with the +

ex: newString = string1 + string2;

Scanner object knows: How toread from the screen

Package to import: import java.util.Scanner;

How to create a Scanner for your screen:

How to use a Scanner to read from your screen:

Methods that work on Scanner: