Berkshire Hathaway chairman Warren Buffett and J.P. Morgan Chase chief executive Jamie Dimon told CNBC the U.S. economy is in rare form and could continue to prove strong for years to come.

In an exclusive joint interview with CNBC's Becky Quick, Dimon and Buffett cited several aspects of the economy as reasons for optimism.

"Right now, there's no question: It's feeling strong. I mean, if we're in the sixth inning, we have our sluggers coming to bat right now," Buffett said in the "Squawk Box" the interview that aired Thursday.

"I'm no good at predicting out two or three or five years from now, although I will say this: There's no question in my mind that America's going to be far ahead of where we are now 10, 20 and 30 years from now," the 87-year-old billionaire added. "But right now, business is good. There's no question about it."

But Buffett cautioned that a strong economy doesn't necessarily mean it's a good time to buy stocks.

"The decision on the stock market should be made independent of the current business outlook," Buffett said. "I don't think you should buy stocks based on what you think the next six months or year is going to bring."

Dimon — who has been J.P. Morgan CEO since 2005 — echoed Buffett's positive comments on economic growth, saying that the current uptrend in business could last years.

"The way I look at it, there is nothing that is a real pothole," he said. "Business sentiment is almost at the highest level it's ever been, consumer sentiment is at its highest levels, markets are wide open, housing's in short supply and my guess is mortgage credit will expand a little bit."

The two business leaders spoke as indicators of economic health continued to show strength. The unemployment rate, for example, fell to an 18-year low of 3.8 percent, according to figures released Friday, while second-quarter growth may reach 4.5 percent, according to the Atlanta Fed's GDPNow tracker.

Source: U.S. Bureau of Labor Statistics, FRED, Federal Reserve Bank of St. Louis

"If you look at how the table's set, consumers are in very good shape," Dimon said. "Their balance sheet, their incomes, wages are going up, their debt levels are low, all the credit written since the Great Recession is pristine, whether it's mortgage credit — other than student lending, which is done by the government."

"So," he concluded. "It looks pretty good."