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

前端 未结 5 1745
挽巷
挽巷 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:52

    in my opinion better practice would be create method Jlabel createLabel(String text, Color foregroundColor) and use it in loop to create labels

提交回复
热议问题