Skip to main content

Variable Handles

  • Chapter
  • First Online:
Exploring Java 9
  • 2077 Accesses

Abstract

A variable handle is a reference to a variable, or to a family of variables, including static fields, nonstatic fields, array elements, or components of an off-heap data structure. The concept of variable handles is similar to method handles. Variable handles are represented using the class java.lang.invoke.VarHandle. With variable handles, you can perform different operations on variables called access modes. All supported access modes are defined in the enum VarHandle.AccessMode.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 19.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 29.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Fu Cheng

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Cheng, F. (2018). Variable Handles. In: Exploring Java 9. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3330-6_8

Download citation

Publish with us

Policies and ethics