Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Missing instance variable declaration in template code for school project  RSS feed

 
Tyler Peterson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is skeleton code for an assignment we were given in my computer science class. If you look to the ChunkyList constructor (line #90), it assigns an argument to what appears to be an instance variable called size, but I can't find any place where such a variable was declared. What am i missing, or misunderstanding?


 
Ahmed Bin S
Ranch Hand
Posts: 385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that variable doesn't exist - the code won't compile. You should ask your lecturer whether this is a mistake, or whether you're expected to add "missing variables" as part of the exercise.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!