Hampered by student loan debt and escalating home prices, millennials prefer stowing away money in savings accounts and certificates of deposit over real estate or stock investments, according to a new survey published Wednesday.

Savings accounts and other cash instruments were viewed as the most viable investment strategy by 30 percent of millennials between the ages of 18 and 37, a stark departure from older generations of Americans who preferred the stock market and real estate, according to a survey of 1,000 respondents by Bankrate.com, a New York-based consumer financial services company.

Only 21 percent of millennials viewed real estate as an ideal investment.

“For investment horizons of longer than 10 years, the stock market is an entirely appropriate investment,” Bankrate Financial Analyst Greg McBride said. “Cash is not, and especially if you’re not seeking out the most competitive returns.”

Among respondents of all ages, 32 percent viewed the stock market as the best investment, while only 24 percent chose cash instruments such as a savings account as the most lucrative option. Real estate clocked in at third, with just 22 percent of respondents describing it as an ideal investment.

Gold and other precious metals tallied 9 percent, bonds scored 8 percent and cryptocurrency 2 percent, according to results of the survey, done annually in collaboration with GfK Custom Research North America.

Courtesy of Bankrate.com

Between 2014 and 2017, real estate had been the first investment choice among Americans of all age groups in previous Bankrate.com surveys. With slumping home sales, rising prices and low inventory, however, fewer people say they have the cash on hand to invest in real estate.

While stocks came up as a clear favorite among Generation X, Baby Boomer and Silent Generation respondents, cash was favored by millennials for the first time in the six-year history of the Bankrate.com survey.

The predilection for cash, according to the report, could be prompted by millennials’ fear of risk when many are already struggling with student loans debt and the high costs of housing.

“Given that anxiety, millennials may say they prefer cash because it’s hard to imagine owning funds you won’t need in a decade,” writes Taylor Tepper, the author of a report tied to the new survey.