Among the many corporations that pay a dividend, some do so unpredictably and irregularly. Others rarely raise their payouts -- perhaps once every few years -- while others still quickly resort to dividend cuts once the going gets rough.

Those companies that can regularly pay and raise their dividends and do so for a long time are a special breed. Businesses of this kind often have the qualities of "forever stocks." That is the case for two healthcare giants: Abbott Laboratories (ABT -0.24%) and Johnson & Johnson (JNJ -0.36%). These corporations' shares are worth investing in and holding on to for good. 

1. Abbott Laboratories

Abbott Laboratories is best known for its medical device business, although the company's portfolio is diversified. It operates across three other segments: diagnostics, pharmaceuticals, and nutrition. It also boasts deep footprints in dozens of countries worldwide.

Abbott Laboratories generates consistent revenue and earnings. Even when it encounters issues, it finds ways to get around them. It did so in recent years: Although the pandemic hurt its medical-devices business, Abbott Laboratories developed coronavirus diagnostic tests to help sustain its revenue. Then there were issues related to its baby formula, but even then, Abbott kept moving in the right direction.

In the second quarter, the company's revenue of $10.4 billion increased by 4% year over year. Abbott Laboratories' top line rose by 9.3% year over year organically, excluding sales of its COVID-19 diagnostic tests. The company's adjusted earnings per share of $1.14 climbed 5.6% from the year-ago period.

Abbott Laboratories has a long and successful track record of innovation, financial results, and stock market performance. And although the past is no guarantee, the company still has the tools to perform well in the long run.

The healthcare giant has vast experience navigating one of the most regulated industries -- the healthcare sector -- and one that won't become obsolete anytime soon. It also has various long-term tailwinds and growth drivers.

Perhaps none is more important than its continuous glucose monitoring (CGM) franchise, the FreeStyle Libre. It has been its best-performing device for years, but as Abbott reported earlier this year, only 1% of the half-billion adults with diabetes worldwide have access to CGM technology. There is a long runway for growth as Abbott Laboratories enters those markets where CGM penetration is low.

What of the company's dividend, which at 1.9% tops the average for the S&P 500? Abbott Laboratories has increased its payouts for 52 consecutive years, which makes it a Dividend King. That's an impressive streak the company should maintain for a long time, thanks to its rock-solid underlying business. Investors can safely keep this stock in their portfolios for good.

2. Johnson & Johnson

Johnson & Johnson is also a Dividend King. It has raised its payout for 62 consecutive years, 10 more than Abbott Laboratories. Johnson & Johnson's streak should give investors confidence that it can survive its current challenges and thrive long after they are gone.

The drugmaker is under threat from the Inflation Reduction Act (IRA), or at least a section of this relatively new law that grants Medicare the power to negotiate the prices of drugs it spends the most on. Three of Johnson & Johnson's medicines will be targeted in the first round of negotiations. Fortunately, these drugs don't feature in the company's midterm growth plans. However, subsequent rounds of negotiations could go after more of Johnson & Johnson's therapies.

The good news is that the company has navigated major healthcare-related regulatory changes for more than 100 years. When Johnson & Johnson was first created, Medicare didn't exist (it was established in 1965), and the U.S. Food and Drug Administration did not require efficacy data before approving medicines (that came in 1962). Johnson & Johnson has produced major medical breakthroughs despite these and many other changes. It boasts a vast lineup of products across multiple therapeutic areas and medical devices.

Johnson & Johnson records consistent revenue and earnings, and its balance sheet is rock solid. That's why it has an AAA rating from Standard & Poor, which is even higher than that of the U.S. government. Investors don't have to worry about Johnson & Johnson cutting its dividend, which yields an appealing 3%.