It depends.
If load permits, they won't use the rear upper deck Y cabin. This will allow J passsengers to pass through this empty cabin to the door, while upper deck Y passengers in the front cabin are held back.
You should be able to tell which is the case from the seatmap in Manage a Booking.