Does the number of classes show any impact on the speed of an application?

For example if there are more number of classes (or packages) does it make the application to run slow compared to the one that has less number of classes (or packages)?

Thanks in advance.

6 Years
Discussion Span
Last Post by *sharath*

And does passing array lists between classes show any impact on speed?

My problem is I am using seperate adapter classes and created an application.
But my team lead asked me to reduce the number of classes because it effects the speed.


But my team lead asked me to reduce the number of classes because it effects the speed.

Could it be that he asked you to minimize number of classes where the array is passed through before used instead of reducing actual class count of the project?

Without knowing more about project, what sort of data are passed around and for what reason, it would be pointless to give some definetive answer.

If data are static you may want to place them in resource folder as array, if they dynamic, provided by user, you may consider use of SharedPreferences or database.


The data is from the service .
I am passing an array list to set a custom adapter like

mListview.setAdapter(new MyCustomAdapter(this , array_List));

I am having 4 activities where i need to set a custom adapter and i used the custom adapter in a seperate class file (like MyCustomAdapter.java) rather using it in the same file where i wrote the activity.


ok thanks for the information.
So i understood that the number of classes wont effect the speed but passing of information between classes matter.
Thank you.

Edited by *sharath*

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.