A class is a chunk of code that can be reused as an object. An object is a single instance of something that can have certain properties (e.g. an integer representing a characters intelligence or money amount). Now that we have that settled...
Going light on object creation and heavy on object reuse is generally better. It uses significantly less RAM to stuff your 50 objects into an array and spit them out and recycle them when needed than it does to create a new instance of said object. Every single object uses RAM (albeit, usually small chunks, but Android devices dont have much to begin with) and the more seperate instances you have the more lag appears.
OpenGL based game engines (libGdx, anyone?) are generally pretty good on memory management, but abuse of object creation will still trigger the garbage collector. If you are using the Android Canvas class with bitmaps to make your game, you have to be extremely careful on how you use available memory.
Your typical song can be 20 mb. Some of the lower end phones have 50 mb of memory available to each app. Creating 50 instances of a song will cause an out of memory exception(OOE). Creating 50 instances of a object with a 1 mb image file will also cause this exception.
I suggest that you check out the "For Dummies" series of books. This is not an insult, as some would take it if I left it at that, but these books are generally very descriptive and you will have the basics of Java down in no time.
1.) Java for Dummies
2.)Java Game Programming for Dummies
3.) Android Application Development for Dummies
4.) Android Game Programming for Dummies
5.) Beginning Android Games
After you have read these books (in the order given if you have any hope of understanding more advanced concepts) you are ready to either make your own game from nothing or to use a game engine. After reading these I believe you will be better suited for learning libGdx game development since the last book essentially shows you how it operates under the hood. After that read these tutorials and your good to go!
double Weight
andint Age
and250 methods
. If we instantiate 2000 students, the number of bytes in RAM we allocate is 2000*(8 + 4) bytes. I don't understand what you mean by "recycling classes". There is no such thing. Each time you use thenew
keyword, a new object is made. \$\endgroup\$