Home > Back-end >  Newbie guide: this code can be simplified? I always feel I write too complicated
Newbie guide: this code can be simplified? I always feel I write too complicated

Time:10-07




Had just finished studying inheritance, the array before knowledge together, although the code a lot, but finally can output, but I always think where there is a problem, a great god please help can look down to simplify
Appreciate

CodePudding user response:


Array transpose approach here

CodePudding user response:

There is nothing wrong with the code, as his knowledge of Java beginners, there is no need to modify,
If it is based on the actual combat, do not suggest using ordinary array to simulate variable length arrays -- ArrayList, basically can be competent for the Vector, also do not recommend using the selection method, the efficiency is too low,

CodePudding user response:

If ArrayTanspostion constructor can accept the array would be much better,

CodePudding user response:

Not complicated, even some simple, arraylist bottom is also a static array, its efficiency is much higher than the add method you,

At least in the guarantee function, efficiency under the premise of simplified code,

Now that you learned to inherit, inherit this class to change it for you,

CodePudding user response:

Very good ah, the complexity, the feeling you want to a little more
  • Related