Created
November 1, 2020 11:04
-
-
Save cbmgit/427879cb07167d59fb70898e2d516d1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rect = {area = 0, length = 0, breadth = 0} | |
function Rect:new (o,length,breadth) | |
o = o or {} | |
setmetatable(o, self) | |
self.__index = self | |
self.length = length or 0 | |
self.breadth = breadth or 0 | |
self.area = length*breadth; | |
return o | |
end | |
function Rect:printRect () | |
print("The calculated Area of Rect: ",self.area) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment