+ 2
What difference between two statement in my code?
Why does first program output"nothing1" but second doesn't? If i am not wrong,Newly created array of object has null references ,then why so. https://code.sololearn.com/cZ86TkiA9owr/?ref=app
6 odpowiedzi
+ 4
Seems like you forgot to link your code in here. Consider updating the question with proper code to get better help from the community.
+ 3
shreyash joshi Are you sure it's working on your side? 'cause I'm getting a compilation error🤔.
+ 3
Shreyash Joshi
Your code contains invalid characters which prevents the compiler from processing it, they appear like spaces but they really are not. You must remove them to get the code to work.
Those invalid characters are not visible via SoloLearn app editor, try to open the code in a browser, there you may see them. Alternatively, try to open the code in ANSI(ASCII) encoding mode if your text editor came with multiple encoding support, this will also reveal the invalid characters.
Hth, cmiiw
+ 1
Yes but its working fine on other compiler . I checked with compiler app.
+ 1
Temp2 refers to an array object that created in the memory:
"new Animal[5]" is not null it's a reference of Animal Array in the memory
but the indecies of array are null.
0
Yes,i link now.but its giving compilation error in this compiler.