Test

From Wiki Knowledge Base | Teltonika GPS

-- Meta class Rectangle = {area = 0, length = 0, breadth = 0}

-- Derived class method new

function Rectangle: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 self.area

end

-- Derived class method printArea

function Rectangle:printArea ()

  return self.area

end