O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. The class definition files we will use in this recipe are available at the location, chp13/4_oo_programming, in the code downloads for this book.
  2. There are three class definition files: Engine.java, Dimensions.java, and Car.java.
  3. Navigate to the directory where these three class definition files are available.
  4. The /open command allows loading the code from within a file. 
  5. We will load the Engine class definition and create an Engine object. 
  1. Next, we will load the Dimensions class definition and create a Dimensions object:
  1. Finally, we will load the Car class definition and create a Car object:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required