Once you have defined and compiled both the Movie
class and the
JamesBondMovie
class, you can use both:
public class Demonstrate { public static void main (String argv[]) { int script = 6, acting = 9, direction = 8; System.out.print("The ordinary rating of the movie is "); System.out.println(Movie.movieRating(script, acting, direction)); System.out.print("The James Bond movie rating of the movie is "); System.out.println( JamesBondMovie.movieRating(script, acting, direction) ); } } --- Result --- The ordinary rating of the movie is 23 The James Bond movie rating of the movie is 27