Uses of Class java.lang.Boolean (Java Platform SE 8 )
Date: 2026-07-22

## Uses of Class
java.lang.Boolean

- Packages that use Boolean
  Package | Description
  --- | ---
  java.awt.font | Provides classes and interface relating to fonts.
  java.lang | Provides classes that are fundamental to the design of the Java programming language.
  java.net | Provides the classes for implementing networking applications.
  java.time.format | Provides classes to print and parse dates and times.
  java.util | Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).
  java.util.concurrent | Utility classes commonly useful in concurrent programming.
  java.util.stream | Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.
  javax.management | Provides the core classes for the Java Management Extensions.
  javax.management.loading | Provides the classes which implement advanced dynamic loading.
  javax.management.modelmbean | Provides the definition of the ModelMBean classes.
  javax.management.monitor | Provides the definition of the monitor classes.
  javax.management.openmbean | Provides the open data types and Open MBean descriptor classes.
  javax.management.relation | Provides the definition of the Relation Service.
  javax.management.remote | Interfaces for remote access to JMX MBean servers.
  javax.management.timer | Provides the definition of the Timer MBean.
  javax.swing | Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms.
  javax.swing.filechooser | Contains classes and interfaces used by the `JFileChooser` component.
  javax.swing.plaf.basic | Provides user interface objects built according to the Basic look and feel.
  javax.tools | Provides interfaces for tools which can be invoked from a program, for example, compilers.

- - ### Uses of Boolean in java.awt.font

    Fields in java.awt.font declared as Boolean
    Modifier and Type | Field and Description
    --- | ---
    `static Boolean` | TextAttribute.`RUN_DIRECTION_LTR` Left-to-right run direction.
    `static Boolean` | TextAttribute.`RUN_DIRECTION_RTL` Right-to-left run direction.
    `static Boolean` | TextAttribute.`STRIKETHROUGH_ON` A single strikethrough.
    `static Boolean` | TextAttribute.`SWAP_COLORS_ON` Swap foreground and background.

  - ### Uses of Boolean in java.lang

    Fields in java.lang declared as Boolean
    Modifier and Type | Field and Description
    --- | ---
    `static Boolean` | Boolean.`FALSE` The `Boolean` object corresponding to the primitive value `false`.
    `static Boolean` | Boolean.`TRUE` The `Boolean` object corresponding to the primitive value `true`.

    Fields in java.lang with type parameters of type Boolean
    Modifier and Type | Field and Description
    --- | ---
    `static Class<Boolean>` | Boolean.`TYPE` The Class object representing the primitive type boolean.

    Methods in java.lang that return Boolean
    Modifier and Type | Method and Description
    --- | ---
    `static Boolean` | Boolean.`valueOf(boolean b)` Returns a `Boolean` instance representing the specified `boolean` value.
    `static Boolean` | Boolean.`valueOf(String s)` Returns a `Boolean` with a value represented by the specified string.

    Methods in java.lang with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `int` | Boolean.`compareTo(Boolean b)` Compares this `Boolean` instance with another.

  - ### Uses of Boolean in java.net

    Fields in java.net with type parameters of type Boolean
    Modifier and Type | Field and Description
    --- | ---
    `static SocketOption<Boolean>` | StandardSocketOptions.`IP_MULTICAST_LOOP` Loopback for Internet Protocol (IP) multicast datagrams.
    `static SocketOption<Boolean>` | StandardSocketOptions.`SO_BROADCAST` Allow transmission of broadcast datagrams.
    `static SocketOption<Boolean>` | StandardSocketOptions.`SO_KEEPALIVE` Keep connection alive.
    `static SocketOption<Boolean>` | StandardSocketOptions.`SO_REUSEADDR` Re-use address.
    `static SocketOption<Boolean>` | StandardSocketOptions.`TCP_NODELAY` Disable the Nagle algorithm.

  - ### Uses of Boolean in java.time.format

    Methods in java.time.format that return types with arguments of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `static TemporalQuery<Boolean>` | DateTimeFormatter.`parsedLeapSecond()` A query that provides access to whether a leap-second was parsed.

  - ### Uses of Boolean in java.util

    Method parameters in java.util with type arguments of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `static <E> Set<E>` | Collections.`newSetFromMap(Map<E,Boolean> map)` Returns a set backed by the specified map.

  - ### Uses of Boolean in java.util.concurrent

    Methods in java.util.concurrent that return types with arguments of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `static <K> ConcurrentHashMap.KeySetView<K,Boolean>` | ConcurrentHashMap.`newKeySet()` Creates a new `Set` backed by a ConcurrentHashMap from the given type to `Boolean.TRUE`.
    `static <K> ConcurrentHashMap.KeySetView<K,Boolean>` | ConcurrentHashMap.`newKeySet(int initialCapacity)` Creates a new `Set` backed by a ConcurrentHashMap from the given type to `Boolean.TRUE`.

  - ### Uses of Boolean in java.util.stream

    Methods in java.util.stream that return types with arguments of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `static <T> Collector<T,?,Map<Boolean,List<T>>>` | Collectors.`partitioningBy(Predicate<? super T> predicate)` Returns a `Collector` which partitions the input elements according to a `Predicate`, and organizes them into a `Map<Boolean, List<T>>`.
    `static <T,D,A> Collector<T,?,Map<Boolean,D>>` | Collectors.`partitioningBy(Predicate<? super T> predicate, Collector<? super T,A,D> downstream)` Returns a `Collector` which partitions the input elements according to a `Predicate`, reduces the values in each partition according to another `Collector`, and organizes them into a `Map<Boolean, D>` whose values are the result of the downstream reduction.

  - ### Uses of Boolean in javax.management

    Methods in javax.management with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `void` | MBeanRegistration.`postRegister(Boolean registrationDone)` Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.
    `void` | StandardMBean.`postRegister(Boolean registrationDone)` Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.

  - ### Uses of Boolean in javax.management.loading

    Methods in javax.management.loading with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `void` | MLet.`postRegister(Boolean registrationDone)` Allows the m-let to perform any operations needed after having been registered in the MBean server or after the registration has failed.

  - ### Uses of Boolean in javax.management.modelmbean

    Methods in javax.management.modelmbean with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `void` | RequiredModelMBean.`postRegister(Boolean registrationDone)` Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.

  - ### Uses of Boolean in javax.management.monitor

    Methods in javax.management.monitor with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `void` | Monitor.`postRegister(Boolean registrationDone)` Allows the monitor MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.

  - ### Uses of Boolean in javax.management.openmbean

    Fields in javax.management.openmbean with type parameters of type Boolean
    Modifier and Type | Field and Description
    --- | ---
    `static SimpleType<Boolean>` | SimpleType.`BOOLEAN` The `SimpleType` instance describing values whose Java class name is `java.lang.Boolean`.

  - ### Uses of Boolean in javax.management.relation

    Methods in javax.management.relation that return Boolean
    Modifier and Type | Method and Description
    --- | ---
    `Boolean` | RelationService.`hasRelation(String relationId)` Checks if there is a relation identified in Relation Service with given relation id.
    `Boolean` | RelationServiceMBean.`hasRelation(String relationId)` Checks if there is a relation identified in Relation Service with given relation id.
    `Boolean` | RelationSupportMBean.`isInRelationService()` Returns an internal flag specifying if the object is still handled by the Relation Service.
    `Boolean` | RelationSupport.`isInRelationService()` Returns an internal flag specifying if the object is still handled by the Relation Service.

    Methods in javax.management.relation with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `Integer` | RelationService.`checkRoleWriting(Role role, String relationTypeName, Boolean initFlag)` Checks if given Role can be set in a relation of given type.
    `Integer` | RelationServiceMBean.`checkRoleWriting(Role role, String relationTypeName, Boolean initFlag)` Checks if given Role can be set in a relation of given type.
    `void` | RelationService.`postRegister(Boolean registrationDone)`
    `void` | RelationSupport.`postRegister(Boolean registrationDone)`
    `void` | RelationSupportMBean.`setRelationServiceManagementFlag(Boolean flag)` Specifies whether this relation is handled by the Relation Service.
    `void` | RelationSupport.`setRelationServiceManagementFlag(Boolean flag)`

  - ### Uses of Boolean in javax.management.remote

    Methods in javax.management.remote with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `void` | JMXConnectorServer.`postRegister(Boolean registrationDone)`

  - ### Uses of Boolean in javax.management.timer

    Methods in javax.management.timer that return Boolean
    Modifier and Type | Method and Description
    --- | ---
    `Boolean` | TimerMBean.`getFixedRate(Integer id)` Gets a copy of the flag indicating whether a periodic notification is executed at fixed-delay or at fixed-rate.
    `Boolean` | Timer.`getFixedRate(Integer id)` Gets a copy of the flag indicating whether a periodic notification is executed at fixed-delay or at fixed-rate.

    Methods in javax.management.timer with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `void` | Timer.`postRegister(Boolean registrationDone)` Allows the timer MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.

  - ### Uses of Boolean in javax.swing

    Methods in javax.swing with parameters of type Boolean
    Modifier and Type | Method and Description
    --- | ---
    `void` | GroupLayout.`setHonorsVisibility(Component component, Boolean honorsVisibility)` Sets whether the component's visibility is considered for sizing and positioning.
    `protected void` | DefaultDesktopManager.`setWasIcon(JInternalFrame f, Boolean value)` Sets that the component has been iconized and the bounds of the `desktopIcon` are valid.

  - ### Uses of Boolean in javax.swing.filechooser

    Methods in javax.swing.filechooser that return Boolean
    Modifier and Type | Method and Description
    --- | ---
    `Boolean` | FileView.`isTraversable(File f)` Whether the directory is traversable or not.
    `Boolean` | FileSystemView.`isTraversable(File f)` Returns true if the file (directory) can be visited.

  - ### Uses of Boolean in javax.swing.plaf.basic

    Fields in javax.swing.plaf.basic with type parameters of type Boolean
    Modifier and Type | Field and Description
    --- | ---
    `protected Hashtable<TreePath,Boolean>` | BasicTreeUI.`drawingCache` Used for minimizing the drawing of vertical lines.

    Methods in javax.swing.plaf.basic that return Boolean
    Modifier and Type | Method and Description
    --- | ---
    `Boolean` | BasicFileChooserUI.BasicFileView.`isHidden(File f)`

  - ### Uses of Boolean in javax.tools

    Methods in javax.tools that return Boolean
    Modifier and Type | Method and Description
    --- | ---
    `Boolean` | DocumentationTool.DocumentationTask.`call()` Performs this documentation task.
    `Boolean` | JavaCompiler.CompilationTask.`call()` Performs this compilation task.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.