Hi guys, I'm just starting out coding in college and I can't seem to find an answer for this.
So i've got a 2D array of type Being (which is my superclass, the subclasses are "fish" and "bear", and they require a name and X and Y locations for the 2d array.), and i want to print out the name at the location to display the 5x5 array i have.
However, when i do this it instead prints out the memory location instead of the name.
How can i fix this? I expect it to be printing "Alpha" at location [0][0].
Will post print method and superclass next.
Apologies if this isn't necessarily following G's rules, I don't ever post here, but I thought you guys would know.
Here is my superclass im calling from for the fish and bear subclasses.
They dont have any differences yet, except later on i will add that if a fish is put at the same location as a bear, it becomes null.
>>58861974
You're not even putting the fish into the river, you're just saying they are fish
you need to say;
River[0,0] = new Fish("alpha,0,0);
River[1,2] = new Fish("fish2",1,2); etc..
change majors
>>58862297
no i did set the location, i only did it for one of them though (Fish a, aka "alpha")
>>58862325
shut up nerd, i already fixed it.
>>58862344
>i already fixed it
your major is saved! huzzah!
>>58861974
install gentoo
>>58862344
What is that fucking indentation on line 22 holy shit. Also fix the goddamn warnings, lint is there for a reason
>>58861974
what the fuck are you doing OP