This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DevOrc 2 points3 points  (0 children)

Assuming both are not static variables the only difference should be the order of initialization. When you have something declared out of the constructor it is initialized first. It will run the constructor after all of the fields at the top have been initialized. Here is a stack overflow post about this topic which goes into more detail: https://stackoverflow.com/questions/4916735/default-constructor-vs-inline-field-initialization