LangStudies/Builds/Tests/14.Classes.letter
Ed94 0acd6ecbaf BAPFS Lecture 18
Instead of making a cli I made updates the gui to open any file.
2022-07-14 01:55:31 -04:00

33 lines
308 B
Plaintext

class Point
{
def constructor(x, y)
{
this.x = x;
this.y = y;
}
def sum()
{
return this.x + this.y;
}
}
class Point3D extends Point
{
def constructor(x, y, z)
{
super(x, y);
this.z = z;
}
def sum()
{
return super() + this.z;
}
}
let
point = new Point(10, 20, 30);
point.sum();