No. Both were part of the Austro-Hungarian Empire (1867–1918). They did not become separate independent nations at the same time.