Jonya | Getty Images

College costs continue to rise, but one segment might not be very worried: 24 percent of millennials said they expect their loans will ultimately be forgiven, according to a study released Wednesday by Junior Achievement and PwC US. That could be a lot of accumulated debt, considering the average amount of cumulative student debt for undergraduates in the class of 2012 was $26,885, according to a recent Pew Research report. The average debt for 2013 graduates is expected to be even higher.

"It's a scary statistic," said Jack Kosakowski, president of Junior Achievement, which co-sponsored the Ypulse survey.

Read MoreActivist group battles student debt crisis

But their millennial optimism might not be too far off base, according to the Consumer Financial Protection Bureau, a watchdog agency set up after the financial crisis. It estimates that 25 percent of the U.S. workforce is employed by a public service employer and "many may be eligible for existing student loan repayment benefits, including Public Service Loan Forgiveness," according to the CFPB website.

Read MoreStudent loan forgiveness may be coming in the future

In June, President Barack Obama issued an executive action to expand eligibility years for the student loan forgiveness program, which eliminates a portion of the debt for graduates who work full-time in qualifying public sector or nonprofit jobs. In addition, the borrower must have a direct loan and an income-driven repayment plan, according to the Department of Education. If all those boxes have been ticked, the borrower should be eligible for forgiveness once they've made 120 monthly payments, making them basically free and clear of their federal loans after a decade.