A tiny annoyance I have in my code right now - these two lines of code:
int i = 1;
listOfIntegers.add(i);
I would really like these to be one line but I can't for the life of me find anything like "new int[] {1}" or similar. Is this possible?
Yes, it is, and it is as easy as possible :)
listOfIntegers.add(1);
PS : For primitive data types you dont have to create "instances" of them, they are instances itself.
listOfIntegers.add(9-8); do the same as listOfIntegers.add(1);