Nand2Tetris Questions and Answers Forum
›
Operating System
›
Project 12
Search
everywhere
only in this topic
Advanced Search
Variable not initialized?
Classic
List
Threaded
♦
♦
Locked
3 messages
Mikey2520
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Variable not initialized?
I am implementing Screen but the complier keeps telling me my color variable is not found.
cadet1620
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Variable not initialized?
Administrator
field
defines a class
instance
variable. That variable will only exist in objects of that class type, and can only be referenced in the class
constructors
and
methods
.
Your 'color' variable needs to be
static
, like "twoToThe".
--Mark
Mikey2520
Reply
|
Threaded
Open this post in threaded view
♦
♦
|
Re: Variable not initialized?
Thank you so much!!!!!
Free forum by Nabble
Edit this page