1

Should I name a final List as

private final List<MaleSwimmer> MALE_SWIMMER_LIST=new ArrayList<>(); 

or

private final List<MaleSwimmer> maleSwimmerList=new ArrayList<>();   

or

private final List<MaleSwimmer> maleSwimmers=new ArrayList<>();     

or

private final List<MaleSwimmer> MALESWIMMERS=new ArrayList<>();      

What is the best coding convention?

chamathabeysinghe
  • 858
  • 2
  • 13
  • 34

2 Answers2

1

I would rather prefer maleSwimmers as it is simple and it states what is that. It is not necessary to put List in the name.

malaguna
  • 4,183
  • 1
  • 17
  • 33
0

Number 2 or 3 I guess, but all of them are OK for the compiler. Note that when you instantiate, use the containing object

Klitos G.
  • 806
  • 5
  • 14