Home Segments Top Top Previous Next

192: Mainline

In the program in Segment 178, you saw the rating method defined as follows for Movie instances:

public static int rating (Movie m) { 
 return m.script + m.acting + m.direction; 
} 

You can transform rating from a class method into an instance method. Each instance method has one special argument, called the target: