In the previous chapter, we saw how to declare and define an array and covered multiple types of arrays such as the indexed array, associative arrays, and so on. We also saw the various operations that can be performed on an array.
In this chapter, we will identify how to define and call functions. We will also learn how to create classes, and how to use the classes and functions together.
Functions are blocks of code that are packaged into reusable code. A function is a piece of code that returns a value by doing some processing, taking one or more outputs.
A class is a blueprint for an object. Classes form the structure of data and the actions that utilize the information to create objects.
By the end of this chapter, you will be able to:
Define and call functions
Define classes and create instances of the class using the
new
keywordImplement and call
public
andstatic
class functions