Sunny days and summertime festivities are on the horizon for June. But there's no guarantee the clouds overhanging the broader market will dissipate.

Instead of trying to guess what the stock market will do in the short term, a better approach is to invest in companies with strong underlying investment theses that have the staying power to endure economic cycles.

Here's why these Fool.com contributors see Apple (AAPL -0.14%), Shopify (SHOP -1.39%), Cava Group (CAVA 1.16%), ExxonMobil (XOM -1.40%), and Energy Transfer (ET -2.07%) as five top stocks to buy in June.

A person smiling while leaning out of a car window by a body of water.

Image source: Getty Images.

Apple's pricing power will be put to the test

Daniel Foelber (Apple): There are 30 components in the Dow Jones Industrial Average (^DJI -0.22%), and the worst-performing year to date is health insurance giant UnitedHealth (NYSE: UNH) -- which crashed due to cost pressures, regulatory scrutiny, suspended guidance, and another major leadership change. However, it's the second-worst performing Dow stock that is piquing my interest in June -- Apple.

Apple is down 22% year to date at the time of this writing -- making it the worst-performing "Magnificent Seven" stock. I think the sell-off is an excellent opportunity for long-term investors.

The simplest reason to buy Apple is if you think it can pass along a decent amount of tariff-related cost pressures. The latest update at the time of this writing is a 25% tariff on smartphones made outside the U.S. And since Apple assembles the vast majority of iPhones in China, the tariff could directly impact its bottom line.

Given higher labor costs and manufacturing challenges, moving production to the U.S. isn't a viable option. So, the million-dollar questions are how long tariffs will last and if Apple can pass along some of its higher costs to consumers.

A major catalyst that could drive iPhone demand even if prices go up is the upgrade cycle. Apple releases new iPhones every September. Most consumers aren't upgrading every year, but rather, waiting until they need to upgrade or the features appeal to them.

The upcoming iPhone 17 could have far more artificial intelligence (AI) features than the iPhone 16 -- which could attract buyers even with a higher price tag. Investors will learn more about Apple's technological advancements at its Worldwide Developers Conference from June 9 to 13.

Also, in Apple's favor, its pricing has stayed consistent for years. The base price of a new iPhone hasn't changed since 2017 as the company has preferred to keep prices low to get consumers involved in its ecosystem to support growth in its services segment. Apple's product growth has been weak in recent years, but the services segment has flourished, led by Apple TV+, Apple Music, Apple Pay, iCloud, and more.

Given tariff woes, it's easy to be sour on Apple stock right now. But the glass-half-full outlook on the company is that if tariffs do persist, at least they are coming during a time when Apple is expected to make by far its most innovative iPhone ever.

All told, long-term investors looking for an industry-leading company to buy in June should consider scooping up shares of Apple.

A growing e-commerce platform giant

Demitri Kalogeropoulos (Shopify): Shopify stock returns are roughly flat so far in 2025, but there are brighter days ahead for owners of this e-commerce services giant. The company just wrapped up a stellar Q1 period, as sales growth landed at 27%. Sure, that was a modest slowdown from the prior period's 31% increase, but it still marked the eighth consecutive quarter of growth of at least 25%.

Merchants are finding plenty of value in Shopify's expanding suite of services, even through the latest disruptive tariff-fueled trade disruptions. Merchant solutions revenue jumped 29%, helping lift sales growth above the company's 23% increase in gross sales volumes. "We built Shopify for times like these," company president Harvey Finklestien said in a press release. "We handle the complexity so merchants can focus on their customers."

Shopify is having no trouble converting those market share gains into rising profits, either. Operating income more than doubled to $203 million, and the company achieved a 15% free cash flow margin, up from 12% a year ago.

Concerns over more trade disruptions have likely kept a lid on the stock price following that positive Q1 earnings report in early May. But the company still expects 2025 growth to be in the mid-20s percentage range year over year. Shopify affirmed its initial aggressive outlook for free cash flow, too, although management sees a slightly slower profit increase (in the low-teens percentage rate) ahead for the year.

Investors can look past that minor profit downgrade and focus on Shopify's broader growth story that involves more merchants signing up for more services and booking more transactions on its platform. Success here should make the stock a great one to add to your portfolio in June, with the aim of holding it for the long term.

A Mediterranean feast for growth investors

Anders Bylund (Cava Group): Shares of Cava Group are down more than 40% in the last six months. That doesn't exactly make it a cheap stock, since Cava trades at 69 times earnings and 9.2 times sales even now.

But the Mediterranean fast-casual restaurant chain is growing quickly while reporting profits, and also widening its profit margins over time. That's a lucrative combo that deserves a premium stock price.

Cava's success hasn't gone unnoticed, despite the plunging stock chart. Two-thirds of analysts who follow this stock have issued a "buy" or "overweight" rating, and Wall Street's average target price is 44% above Thursday's closing price.

The company has a habit of absolutely crushing each quarter's analyst estimates across the board, including a huge surprise in May's first-quarter report. The average analyst expected earnings of just $0.02 per share on revenues in the neighborhood of $281 million. Instead, Cava reported earnings of $0.22 per share and $332 million in top-line sales.

A report like that would normally boost Cava's stock, but the market reaction was negative. Management noted that same-store sales growth could slow down in the second half of 2025, since the unpredictable economy is weighing down consumer spending. Cava's healthy salad bowls and pita wraps are on the pricey side, making the chain a vendor of everyday luxuries. This strategy could make Cava vulnerable to shifts in consumer confidence, especially when paired with the stock's lofty valuation.

So you won't find the stock in Wall Street's bargain basement today, but it did move down from the high-end valuation penthouse it inhabited a few months ago. If you like your investments fresh and flavorful, Cava's combination of healthy growth and expanding profits could be a recipe for long-term portfolio success.

42 dividend raises, with more coming up

Neha Chamaria (ExxonMobil): With renewables on the rise, people often believe the oil and gas industry isn't where to bet on anymore. While the global demand for energy overall is only expected to grow, driven by developing countries, ExxonMobil is in a sweet spot. It is working hard to bring down its break-even oil price significantly to stay relevant in the long run. At the same time, it is developing new low-carbon products and solutions.

It believes these new businesses could have potential addressable markets worth $400 billion by 2030 and over $2.3 trillion by 2050. Biofuels, carbon capture and storage, and low-carbon hydrogen are just some of the new products ExxonMobil is focused on.

Overall, ExxonMobil wants to produce "more profitable barrels and more profitable products" and is also cutting costs aggressively. The oil and gas giant believes a better product mix and its cost-reduction efforts combined could add nearly $20 billion in incremental earnings and $30 billion in operating cash flows by 2030.

In short, ExxonMobil is already charting a growth path to 2030 without compromising on capital discipline. It wants to generate big cash flows and maintain a strong balance sheet even through oil market down cycles, and ensure it can continue to reward shareholders with a sustainable and growing dividend on top of opportunistic share buybacks.

ExxonMobil has already proven its mettle when it comes to shareholder returns. It has increased its dividend each year for the past 42 consecutive years. Even without dividends, the stock has more than doubled shareholder returns in the past five years. With ExxonMobil stock now trading almost 20% off its all-time highs, it is one of the top S&P 500 (^GSPC 0.01%) stocks to buy now and hold.

Ready to rebound

Keith Speights (Energy Transfer): I'm not worried in the least that Energy Transfer LP's unit price is down year to date. This pullback presents a great opportunity to buy the midstream energy stock in June.

Energy Transfer's business continues to rock along. The limited partnership (LP) set a new record for interstate natural gas transportation volume in the first quarter of 2025. Its crude oil transportation volume jumped 10% year over year in Q1. Natural gas liquid (NGL) transportation volumes rose 4%, with NGL exports increasing 5%.

The LP's growth prospects remain solid. Energy Transfer commissioned the first of eight natural gas-powered electric generation facilities in Texas earlier this year. It plans to partner with MidOcean Energy to build a new LNG facility in Lake Charles, Louisiana. Artificial intelligence (AI) is a new growth driver, with Energy Transfer agreeing to provide natural gas to Cloudburst Data Centers' AI data centers.

The Trump administration's tariffs shouldn't affect Energy Transfer much. All of the company's 130,000-plus miles of pipeline are in the U.S. Energy Transfer has already secured most of the steel to be used in phase 1 of its Hugh Brinson pipeline project. Co-CEO Marshall "Mackie" McCrea said in the Q1 earnings call that management doesn't "expect to see any major challenges, if any challenges at all, selling out our terminal every month, the rest of this year."

Even if Energy Transfer's unit price doesn't move much, investors will still make money thanks to the LP's generous distributions. The midstream leader's forward distribution yield currently tops 7.3%. Energy Transfer plans to increase its distribution by 3% to 5% each year.