Is it Better practice to Declare individual objects or loop Anonymous objects into ArrayList?

前端 未结 5 1704
挽巷
挽巷 2021-01-19 23:17

I am learning programming with Java through a textbook. A programming exercise asks you to:

(Swing common features) Display a frame that contains six labels. Set th

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-19 23:39

    I would suggest that if you are learning to program for professional reasons then you should follow as it given in the book. Because in bigger projects (if you might be working on one in future), this practice is very common and as you said, readability and a variable name. Say it is like a convention.

提交回复
热议问题