Documentation ¶
Overview ¶
Hands-on exercise #5
create a type SQUARE --means create a struct create a type CIRCLE attach a method to each that calculates AREA and returns it circle area= π r 2 square area = L * W create a type SHAPE that defines an interface as anything that has the AREA method create a func INFO which takes type shape and then prints the area create a value of type square create a value of type circle use func info to print the area of square use func info to print the area of circle
Click to show internal directories.
Click to hide internal directories.