Japan's GDP rebounded in the second quarter of 2024, growing 3.1% year-on-year in the three months to June.