• Post Reply Bookmark Topic Watch Topic
  • New Topic

which approach is best suited for this scenario?

 
Ajay Xavier
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i want to acheive a functionality. it can be acheived in two ways

1. using an Array(two dimensional string array)
2. creating a new class (which holds the same data stored in a array) and using its object.

At any point of time in the program flow, for a input(say a number between 1-n) given by user
In Approach 1 there will be only one array which holds all the details
In Approach 2 there will be 'n' number of objects.

which approach is efficient and has great perfomance?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The performance difference would depend on how you use the data, but in most cases is unlikely to be significant enough to make it worthwhile to override other design considerations such as maintainability.

For a more specific response, you will need to tell us more about what exactly you are trying to do...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!