-0.3 C
New York
Thursday, March 19, 2026
Array

Java future calls for boosts with records, primitives, classes



The derived record creation JEP in preview, meanwhile, would provide a concise means to create new record values derived from existing record values. The proposal also is intended to streamline the declaration of record classes by eliminating the need to provide explicit wither methods, which are the immutable analog of setter methods. Records are immutable objects, with developers frequently creating new records from old records to model new data. Derived creation streamlines code by deriving a new record from an existing record, specifying only the components that are different, according to the proposal, created in November 2023 and marked as updated in April 2024.

Also cited by Smith were the enhanced primitive boxing JEP, which is a feature in preview, and the primitive types in patterns, instanceof, and switch JEP, a feature actually undergoing its fourth preview in JDK 26. Enhanced primitive boxing, created in January 2021 and marked as updated in November 2025, uses boxing to support language enhancements that treat primitive types more like reference types. Among goals is allowing boxing of primitive values when they are used as the “receiver” of a field access, method invocation, or method reference. Also on the agenda for this JEP is supporting primitive types as type arguments, implemented via boxing at the boundaries with generic code. Unboxed return types would be allowed when overriding a method with a reference-typed return. The primitive types feature, meanwhile, calls for enhancing pattern matching by allowing primitive types in all pattern contexts and by extending instanceof and switch to work with all primitive types. This feature was created in June 2025 and last updated in December 2025.

For arrays, plans under consideration involve declarative array creation expressions, final arrays, non-null arrays, and covariant primate arrays. Declarative array creation covers capabilities including having a lambda to compute initial values. With final arrays, components cannot be mutated and must be declaratively initialized. Covariant primitive arrays can treat an int[] as a non-null Integer[]. Boxes can be accessed as needed.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

CATEGORIES & TAGS

- Advertisement -spot_img

LATEST COMMENTS

Most Popular

WhatsApp