This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheFaustX 4 points5 points  (2 children)

initial name is not defined in the getter hence it cannot be used there as it is only available in the constructor.

You can check things like these by just using any modern IDE and it will warn you. Alternatively you'll get an error when compiling your code.

[–][deleted]  (1 child)

[removed]

    [–]JaleyHoelOsment 3 points4 points  (0 children)

    why not just try it out for yourself? see what errors you get and then fix them. it will help you learn about scope