| INCOME TAXES (Tables)
 | 12 Months Ended | 
| Jun. 30, 2020 | 
|---|
| Income Tax Disclosure [Abstract] |  | 
| Schedule of Income before Income Taxes, Domestic and Foreign | 
The components of income before income taxes were as follows: 
 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Year ended June 30, |  |  |  |  |  
| (In thousands) | 2020 |  | 2019 |  | 2018 |  
| Domestic income before income taxes | $ | 752,844 |  |  | $ | 545,401 |  |  | $ | 716,015 |  |  
| Foreign income before income taxes | 563,867 |  |  | 750,830 |  |  | 739,916 |  |  
| Total income before income taxes | $ | 1,316,711 |  |  | $ | 1,296,231 |  |  | $ | 1,455,931 |  |  | 
| Schedule of Components of Income Tax Expense (Benefit) | 
The provision for income taxes was comprised of the following:  
 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
| (In thousands) | Year ended June 30, |  |  |  |  |  
|  | 2020 |  | 2019 |  | 2018 |  
| Current: |  |  |  |  |  |  
| Federal | $ | 108,136 |  |  | $ | 82,460 |  |  | $ | 504,758 |  |  
| State | 518 |  |  | 5,665 |  |  | 6,422 |  |  
| Foreign | 86,374 |  |  | 59,274 |  |  | 41,414 |  |  
|  | 195,028 |  |  | 147,399 |  |  | 552,594 |  |  
| Deferred: |  |  |  |  |  |  
| Federal | (26,743) |  |  | 1,636 |  |  | 98,702 |  |  
| State | (1,174) |  |  | 2,118 |  |  | 1,526 |  |  
| Foreign | (65,425) |  |  | (29,939) |  |  | 844 |  |  
|  | (93,342) |  |  | (26,185) |  |  | 101,072 |  |  
| Provision for income taxes | $ | 101,686 |  |  | $ | 121,214 |  |  | $ | 653,666 |  |  | 
| Schedule of Deferred Tax Assets and Liabilities | The significant components of deferred income tax assets and liabilities were as follows: 
|  |  |  |  |  |  |  |  |  |  |  |  |  
| (In thousands) | As of June 30, |  |  |  
|  | 2020 |  | 2019 |  
| Deferred tax assets: |  |  |  |  
| Tax credits and net operating losses | $ | 214,305 |  |  | $ | 208,572 |  |  
| Employee benefits accrual | 67,729 |  |  | 65,065 |  |  
| Stock-based compensation | 8,871 |  |  | 9,432 |  |  
|  |  |  |  |  
| Inventory reserves | 73,939 |  |  | 67,249 |  |  
| Non-deductible reserves | 20,526 |  |  | 21,633 |  |  
|  |  |  |  |  
|  |  |  |  |  
| Unearned revenue | 15,786 |  |  | 16,126 |  |  
| Unrealized loss on investments | 5,345 |  |  | 1,492 |  |  
| Other | 66,667 |  |  | 55,518 |  |  
| Gross deferred tax assets | 473,168 |  |  | 445,087 |  |  
| Valuation allowance | (181,846) |  |  | (166,571) |  |  
| Net deferred tax assets | $ | 291,322 |  |  | $ | 278,516 |  |  
| Deferred tax liabilities: |  |  |  |  
| Unremitted earnings of foreign subsidiaries not indefinitely reinvested | $ | (257,757) |  |  | $ | (243,491) |  |  
| Deferred profit | (18,111) |  |  | (15,718) |  |  
| Depreciation and amortization | (439,685) |  |  | (515,643) |  |  
| Total deferred tax liabilities | (715,553) |  |  | (774,852) |  |  
| Total net deferred tax assets (liabilities) | $ | (424,231) |  |  | $ | (496,336) |  |  | 
| Schedule of Effective Income Tax Rate Reconciliation | The reconciliation of the U.S. federal statutory income tax rate to our effective income tax rate was as follows: 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Year ended June 30, |  |  |  |  |  
|  | 2020 |  | 2019 |  | 2018 |  
| Federal statutory rate | 21.0 | % |  | 21.0 | % |  | 28.1 | % |  
| State income taxes, net of federal benefit | 0.2 | % |  | 0.5 | % |  | 0.5 | % |  
| Effect of foreign operations taxed at various rates | (12.1) | % |  | (10.5) | % |  | (11.0) | % |  
| Tax Cuts and Jobs Act of 2017 - Transition tax and deferred tax effects | — | % |  | (1.5) | % |  | 30.3 | % |  
| Global intangible low-taxed income | 3.0 | % |  | 3.5 | % |  | — | % |  
| Foreign derived intangible income | (5.0) | % |  | (4.0) | % |  | — | % |  
| Research and development tax credit | (1.8) | % |  | (1.8) | % |  | (1.4) | % |  
| Net change in tax reserves | 1.5 | % |  | 1.4 | % |  | (0.4) | % |  
| Domestic manufacturing benefit | — | % |  | — | % |  | (1.1) | % |  
|  |  |  |  |  |  |  
| Non-deductible impairment of goodwill | 4.1 | % |  | — | % |  | — | % |  
| Effect of stock-based compensation | (0.3) | % |  | 0.4 | % |  | (0.1) | % |  
| Restructuring | (2.6) | % |  | — | % |  | — | % |  
| Other | (0.3) | % |  | 0.4 | % |  | — | % |  
| Effective income tax rate | 7.7 | % |  | 9.4 | % |  | 44.9 | % |  | 
| Summary of Income Tax Contingencies | 
A reconciliation of gross unrecognized tax benefits was as follows: 
 
|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  
|  | Year ended June 30, |  |  |  |  |  
| (In thousands) | 2020 |  | 2019 |  | 2018 |  
| Unrecognized tax benefits at the beginning of the year | $ | 146,426 |  |  | $ | 63,994 |  |  | $ | 68,439 |  |  
| Increases for tax positions from acquisitions | — |  |  | 60,753 |  |  | — |  |  
| Increases for tax positions taken in prior years | 6,826 |  |  | 13,001 |  |  | 4,642 |  |  
| Decreases for tax positions taken in prior years | (518) |  |  | (1,304) |  |  | (6,045) |  |  
| Increases for tax positions taken in current year | 34,278 |  |  | 26,178 |  |  | 16,812 |  |  
| Decreases for settlements with taxing authorities | — |  |  | — |  |  | (9,666) |  |  
| Decreases for lapsing of statutes of limitations | (14,569) |  |  | (16,196) |  |  | (10,188) |  |  
| Unrecognized tax benefits at the end of the year | $ | 172,443 |  |  | $ | 146,426 |  |  | $ | 63,994 |  |  |