What was the main cause of the surge in California's population between 1840 and 1860?

A) the availability of cheap farmland

B) the migration of freed slaves

C) the discovery of gold

D) the arrival of immigrants from China