It's completely personal preference and highly controversial. The Java people will strangle you for not using #1, but in C/C++ I recommend #2 (and still people will argue).
Just figure out which one makes it easier for you to read and write code and stick with it, but be prepared to use a different style if a group project requires it.
Is there a reason method #1 is preferred by Java programmers? Java is actually a language I am interested in learning at some point and I have no personal preference, so #1 it is.
It has to do with Oracle's styleguide.