9 Import and create packages

After reading this lesson, you’ll be able to

  • Import and reuse code from other packages
  • Structure your program in logical packages

Now that you’ve reviewed the basics of object-oriented programming in unit 1, you’ll learn about packages. They allow you to organize your software in logical groups to navigate your codebase more easily. By importing them, you can reuse them in several parts of your application. You can also publish them, making their code available online for other people to download and use; you refer to a published package as library. In the capstone, you will create a dedicated logical unit for your time application, and you will import and use an internal package called java.time.

Consider this ...

Get Get Programming with Scala now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.