In the second case, the
Messages member will be instantiated upon
Cell instantiation. That means that
msg = new Messages() will be called when you write
new Cell() somewhere in your code.
In the first case, if you instantiate
new Cell() for instance) and call the
getMessage() method without setting anything to
msg first, you'll get a
NullPointerException since the value of an object member is
null by default. This will not be the case in the code you wrote in your second example.
Which solution you should use depends on what you want to do with your code. Both are acceptable and I fear this point is mainly opinion based. You can find more details on a similar question here: Best practice for initializing an ArrayList field in Java.