food to Object??

+2 Albo Coder · February 26, 2015

Can we create an array of Object objects and then assign them individually tuna or potpie?
I mean instead of making a food array can we make an Object array and having the same crap? 

Post a Reply


Oldest  Newest  Rating
0 Albo Coder · March 4, 2015
Thanks. I played with it a little and understood how it works 
0 Branislav Lazic · March 4, 2015
He want's to say: You should make a List of object that have common behavior!
But yes, this is good question.
0 Albo Coder · March 4, 2015
Thanks T P. So you are saying we should better make an array of the class which has the method we want to call.
Thanks for the help. :D
0 T P · February 27, 2015
Yes, it can be done, but to call the methods of your food class you will have to typecast each Object object into Food object. Not a good idea mate.
0 Albo Coder · February 27, 2015

0 Albo Coder · February 26, 2015
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator