having issues with Cannot invoke "java.util.ArrayList.size()" because "this.listOfMicronutrients" is
can not seem to figure it out ?
8 Replies
⌛
This post has been reserved for your question.
Hey @Jflash! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
........ Your list won't exist as long as you don't create it?
i dont understand your question? or you saying if i dont initialize it ?
something like that, yes
I mean, I'm talking about objects not existing if you don't create them, you have an error saying something is null... Do you really need more?
i dont think i do i am just trying to reslove the null issue. and i thought i have initialize it and that would be in the main function correct?
i am guessing i need to properly initialized it?
Are you familiar with how scope works? Initializing it in one class doesn’t mean you have access in another, even if they have the same name.. hard to glean much from a couple of screenshots.
But yea Kyo’s right
Or if both objects are set equal to one another, both will only reference the same object (or in this case null value) as long as one isn’t set to a new object using the new keyword (or set = to some other object), in which case they’ll no longer reference the same object.
Since that’s how Reference Types work.
I rewrite the code and it got fix. thank you for the help.
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.