Yes, they can be connected and they should have an adequate connection. The Code does not stipulate how they're connected, but says it needs to be adequate. If the two ends are not cut perfectly “square” and there is jumping on the post, it could “slide” past the other post, especially if it's a little wet.