Defining Packages

Syntax for defining packages

We define our own package by starting with the keyword package followed by the name you want to give to your new package. It should end with the ; sign. We use 1; at the end of the package definition to mark the end of the scope.

Here’s the general syntax:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy