Table of Contents
Java Map Interface
Return to Java Map, Map, Functional Java, Java DevOps - Java SRE - Java CI/CD, Cloud Native Java - Java Microservices - Serverless Java, Java Security - Java DevSecOps, Java Concurrency, Java Data Science - Java and Databases, Java Machine Learning, Java Bibliography, Java Courses, Java Glossary, Awesome Java, Java GitHub, Java Topics
“ (OCP17SelBoy 2022)
Using the Map Interface
“You use a Map when you want to identify values by a key. For example, when you use the contact list in your phone, you look up “George” rather than looking through each phone number in turn.” (OCP17SelBoy 2022)
“You can envision a Map as shown in Figure 9.8. You don't need to know the names of the specific interfaces that the different maps implement, but you do need to know that TreeMap is sorted.” (OCP17SelBoy 2022)
“The main thing that all Map classes have in common is that they have keys and values. Beyond that, they each offer different functionality. We look at the implementations you need to know and the available methods.” (OCP17SelBoy 2022)
Map.of() and Map.copyOf()
“Just like List and Set, there is a factory method to create a Map. You pass any number of pairs of keys and values.” (OCP17SelBoy 2022)
Map.of(”key1“, ”value1“, ”key2“, ”value2“);
“Unlike List and Set, this is less than ideal. Passing keys and values is harder to read because you have to keep track of which parameter is which. Luckily, there is a better way. Map also provides a method that lets you supply key/value pairs.” (OCP17SelBoy 2022)
Map.ofEntries( Map.entry(”key1“, ”value1“), Map.entry(”key2“, ”value2“));
“Now we can't forget to pass a value. If we leave out a parameter, the entry() method won't compile. Conveniently, Map.copyOf(map) works just like the List and Set interface copyOf() methods.” (OCP17SelBoy 2022)
Comparing Map Implementations
Java Comparing Map Implementations
“A HashMap stores the keys in a hash table. This means that it uses the hashCode() method of the keys to retrieve their values more efficiently.” (OCP17SelBoy 2022)
“The main benefit is that adding elements and retrieving the element by key both have constant time. The trade-off is that you lose the order in which you inserted the elements. Most of the time, you aren't concerned with this in a map anyway. If you were, you could use LinkedHashMap, but that's not in scope for the exam.” (OCP17SelBoy 2022)
“A TreeMap stores the keys in a sorted tree structure. The main benefit is that the keys are always in sorted order. Like a TreeSet, the trade-off is that adding and checking whether a key is present takes longer as the tree grows larger.” (OCP17SelBoy 2022)
Working with Map Methods
Working with Map Methods
“Given that Map doesn't extend Collection, more methods are specified on the Map interface. Since there are both keys and values, we need generic type parameters for both. The class uses K for key and V for value. The methods you need to know for the exam are in Table 9.6. Some of the method signatures are simplified to make them easier to understand.” (OCP17SelBoy 2022)
Map Methods
TABLE 9.6 Map methods
public void clear() Removes all keys and values from map.
public boolean containsKey(Object key) Returns whether key is in map.
public boolean containsValue(Object value) Returns whether value is in map.
public Set<Map.Entry<K,V» entrySet() Returns Set of key/value pairs.
public void forEach(BiConsumer<K key, V value>) Loops through each key/value pair.
public V get(Object key) Returns value mapped by key or null if none is mapped.
public V getOrDefault(Object key, V defaultValue) Returns value mapped by key or default value if none is mapped.
public boolean isEmpty() Returns whether map is empty.
public Set<K> keySet() Returns set of all keys.
public V merge(K key, V value, Function(<V, V, V> func)) Sets value if key not set. Runs function if key is set, to determine new value. Removes if value is null.
public V put(K key, V value) Adds or replaces key/value pair. Returns previous value or null.
public V putIfAbsent(K key, V value) Adds value if key not present and returns null. Otherwise, returns existing value.
public V remove(Object key) Removes and returns value mapped to key. Returns null if none.
public V replace(K key, V value) Replaces value for given key if key is set. Returns original value or null if none.
public void replaceAll(BiFunction<K, V, V> func) Replaces each value with results of function.
public int size() Returns number of entries (key/value pairs) in map.
public Collection<V> values() Returns Collection of all values.
”While Table 9.6 is a pretty long list of methods, don't worry; many of the names are straightforward. Also, many exist as a convenience. For example, containsKey() can be replaced with a get() call that checks if the result is null. Which one you use is up to you.“ (OCP17SelBoy 2022)
Calling Basic Map Methods
Java Calling Basic Map Methods
“Let's start out by comparing the same code with two Map types. First up is HashMap:” (OCP17SelBoy 2022)
Map<String, String> map = new HashMap<>(); map.put(”koala“, ”bamboo“); map.put(“lion”, “meat”); map.put(“giraffe”, “leaf”); String food = map.get(”koala“); // bamboo for (String key: map.keySet()) System.out.print(key + ”,“); // koala,giraffe,lion,
“Here we use the put() method to add key/value pairs to the map and get() to get a value given a key. We also use the keySet() method to get all the keys.” (OCP17SelBoy 2022)
”Java uses the hashCode() of the key to determine the order. The order here happens not to be sorted order or the order in which we typed the values. Now let's look at TreeMap:“ (OCP17SelBoy 2022)
Map<String, String> map = new TreeMap<>(); map.put(”koala“, ”bamboo“); map.put(“lion”, “meat”); map.put(“giraffe”, “leaf”); String food = map.get(”koala“); // bamboo for (String key: map.keySet()) System.out.print(key + ”,“); // giraffe,koala,lion,
”TreeMap sorts the keys as we would expect. If we called values() instead of keySet(), the order of the values would correspond to the order of the keys.“ (OCP17SelBoy 2022)
With our same map, we can try some boolean checks:
System.out.println(map.contains(“lion”)); // DOES NOT COMPILE System.out.println(map.containsKey(“lion”)); // true System.out.println(map.containsValue(“lion”)); // false System.out.println(map.size()); // 3 map.clear(); System.out.println(map.size()); // 0 System.out.println(map.isEmpty()); // true
“The first line is a little tricky. The contains() method is on the Collection interface but not the Map interface. The next two lines show that keys and values are checked separately. We can see that there are three key/value pairs in our map. Then we clear out the contents of the map and see that there are zero elements and it is empty.” (OCP17SelBoy 2022)
In the following sections, we show Map methods you might not be as familiar with.
Iterating Through a Map
“You saw the forEach() method earlier in the chapter. Note that it works a little differently on a Map. This time, the lambda used by the forEach() method has two parameters: the key and the value. Let's look at an example, shown here:” (OCP17SelBoy 2022)
Map<Integer, Character> map = new HashMap<>(); map.put(1, 'a'); map.put(2, 'b'); map.put(3, 'c'); map.forEach1);
“The lambda has both the key and value as the parameters. It happens to print out the value but could do anything with the key and/or value. Interestingly, since we don't care about the key, this particular code could have been written with the values() method and a method reference instead.” (OCP17SelBoy 2022)
map.values().forEach(System.out::println);
“Another way of going through all the data in a map is to get the key/value pairs in a Set. Java has a static interface inside Map called Entry. It provides methods to get the key and value of each pair.” (OCP17SelBoy 2022)
map.entrySet().forEach(e → System.out.println(e.getKey() + ” “ + e.getValue()));
Getting Values Safely
Java Getting Map Values Safely
“The get() method returns null if the requested key is not in the map. Sometimes you prefer to have a different value returned. Luckily, the getOrDefault() method makes this easy. Let's compare the two methods:” (OCP17SelBoy 2022)
3: Map<Character, String> map = new HashMap<>(); 4: map.put('x', “spot”); 5: System.out.println(“X marks the ” + map.get('x')); 6: System.out.println(“X marks the ” + map.getOrDefault('x', ”“)); 7: System.out.println(“Y marks the ” + map.get('y')); 8: System.out.println(“Y marks the ” + map.getOrDefault('y', ”“));
This code prints the following:
X marks the spot X marks the spot Y marks the null Y marks the
“As you can see, lines 5 and 6 have the same output because get() and getOrDefault() behave the same way when the key is present. They return the value mapped by that key. Lines 7 and 8 give different output, showing that get() returns null when the key is not present. By contrast, getOrDefault() returns the empty string we passed as a parameter.” (OCP17SelBoy 2022)
Replacing Values
“These methods are similar to the List version, except a key is involved:” (OCP17SelBoy 2022)
21: Map<Integer, Integer> map = new HashMap<>(); 22: map.put(1, 2); 23: map.put(2, 4); 24: Integer original = map.replace(2, 10); // 4 25: System.out.println(map); // {1=2, 2=10} 26: map.replaceAll((k, v) → k + v); 27: System.out.println(map); // {1=3, 2=12}
”Line 24 replaces the value for key 2 and returns the original value. Line 26 calls a function and sets the value of each element of the map to the result of that function. In our case, we added the key and value together.“ (OCP17SelBoy 2022)
Putting if Absent
Putting if Absent
“The putIfAbsent() method sets a value in the map but skips it if the value is already set to a non-null value.” (OCP17SelBoy 2022)
Map<String, String> favorites = new HashMap<>(); favorites.put(“Jenny”, “Bus Tour”); favorites.put(“Tom”, null); favorites.putIfAbsent(“Jenny”, “Tram”); favorites.putIfAbsent(“Sam”, “Tram”); favorites.putIfAbsent(“Tom”, “Tram”); System.out.println(favorites); // {Tom=Tram, Jenny=Bus Tour, Sam=Tram}
“As you can see, Jenny's value is not updated because one was already present. Sam wasn't there at all, so he was added. Tom was present as a key but had a null value. Therefore, he was added as well.” (OCP17SelBoy 2022)
Merging Data
“The merge() method adds logic of what to choose. Suppose we want to choose the ride with the longest name. We can write code to express this by passing a mapping function to the merge() method:” (OCP17SelBoy 2022)
11: BiFunction<String, String, String> mapper = (v1, v2) 12: → v1.length()> v2.length() ? v1: v2; 13: 14: Map<String, String> favorites = new HashMap<>(); 15: favorites.put(“Jenny”, “Bus Tour”); 16: favorites.put(“Tom”, “Tram”); 17: 18: String jenny = favorites.merge(“Jenny”, “Skyride”, mapper); 19: String tom = favorites.merge(“Tom”, “Skyride”, mapper); 20: 21: System.out.println(favorites); // {Tom=Skyride, Jenny=Bus Tour} 22: System.out.println(jenny); // Bus Tour 23: System.out.println(tom); // Skyride
“The code on lines 11 and 12 takes two parameters and returns a value. Our implementation returns the one with the longest name. Line 18 calls this mapping function, and it sees that Bus Tour is longer than Skyride, so it leaves the value as Bus Tour. Line 19 calls this mapping function again. This time, Tram is shorter than Skyride, so the map is updated. Line 21 prints out the new map contents. Lines 22 and 23 show that the result is returned from merge().” (OCP17SelBoy 2022)
“The merge() method also has logic for what happens if null values or missing keys are involved. In this case, it doesn't call the BiFunction at all, and it simply uses the new value.” (OCP17SelBoy 2022)
BiFunction<String, String, String> mapper = (v1, v2) → v1.length()> v2.length() ? v1 : v2; Map<String, String> favorites = new HashMap<>(); favorites.put(“Sam”, null); favorites.merge(“Tom”, “Skyride”, mapper); favorites.merge(“Sam”, “Skyride”, mapper); System.out.println(favorites); // {Tom=Skyride, Sam=Skyride}
“Notice that the mapping function isn't called. If it were, we'd have a NullPointerException. The mapping function is used only when there are two actual values to decide between.” (OCP17SelBoy 2022)
“The final thing to know about merge() is what happens when the mapping function is called and returns null. The key is removed from the map when this happens:” (OCP17SelBoy 2022)
BiFunction<String, String, String> mapper = (v1, v2) → null; Map<String, String> favorites = new HashMap<>(); favorites.put(“Jenny”, “Bus Tour”); favorites.put(“Tom”, “Bus Tour”); favorites.merge(“Jenny”, “Skyride”, mapper); favorites.merge(“Sam”, “Skyride”, mapper); System.out.println(favorites); // {Tom=Bus Tour, Sam=Skyride}
“Tom was left alone since there was no merge() call for that key. Sam was added since that key was not in the original list. Jenny was removed because the mapping function returned null.” (OCP17SelBoy 2022)
Table 9.7 shows all of these scenarios as a reference.
”TABLE 9.7 Behavior of the merge() method“ (OCP17SelBoy 2022)
If the requested key ________ And mapping function returns ________ Then:
Has a null value in map N/A (mapping function not called) Update key's value in map with value parameter
Has a non-null value in map null Remove key from map
Has a non-null value in map A non-null value Set key to mapping function result
Is not in map N/A (mapping function not called) Add key with value parameter to map directly without calling mapping function
“We conclude this section with a review of all the collection classes. Make sure that you can fill in Table 9.8 to compare the four collection types from memory.” (OCP17SelBoy 2022)
”TABLE 9.8 Java Collections Framework types“ (OCP17SelBoy 2022)
Type Can contain duplicate elements? Elements always ordered? Has keys and values? Must add/remove in specific order?
Map Yes (for values) No Yes No
Queue Yes Yes (retrieved in defined order) No Yes
Set No No No No
Additionally, make sure you can fill in Table 9.9 to describe the types on the exam.
”TABLE 9.9 Collection attributes“ (OCP17SelBoy 2022)
Type Java Collections Framework interface Sorted? Calls hashCode? Calls compareTo?
ArrayDeque Deque No No No
Research More
Fair Use Sources
Java Vocabulary List (Sorted by Popularity)
Java Programming Language, Java Virtual Machine (JVM), Java Development Kit (JDK), Java Runtime Environment (JRE), Java Class, Java Interface, Java Method, Java Object, Java Package, Java String, Java Integer, Java Array, Java List, Java Map, Java Set, Java Exception, Java Thread, Java Synchronization, Java Generic, Java Annotation, Java Stream, Java Lambda Expression, Java Inheritance, Java Polymorphism, Java Encapsulation, Java Abstraction, Java Access Modifier, Java Constructor, Java Overloading, Java Overriding, Java Collection Framework, Java ArrayList, Java HashMap, Java HashSet, Java LinkedList, Java TreeMap, Java TreeSet, Java Iterator, Java Enumeration, Java File, Java InputStream, Java OutputStream, Java Reader, Java Writer, Java BufferedReader, Java BufferedWriter, Java PrintWriter, Java PrintStream, Java Scanner, Java StringBuilder, Java StringBuffer, Java Character, Java Boolean, Java Double, Java Float, Java Byte, Java Short, Java Long, Java BigInteger, Java BigDecimal, Java ClassLoader, Java Reflection, Java Proxy, Java Dynamic Proxy, Java Inner Class, Java Static Nested Class, Java Anonymous Class, Java Enum, Java Autoboxing, Java Auto-Unboxing, Java Garbage Collection, Java Memory Model, Java Just-In-Time Compilation, Java Classpath, Java Module, Java Module Path, Java Record, Java Sealed Class, Java Switch Expression, Java Pattern Matching for instanceof, Java Text Block, Java Var Keyword, Java Interface Default Method, Java Interface Static Method, Java Functional Interface, Java SAM (Single Abstract Method) Interface, Java Optional, Java Stream API, Java Collectors, Java Parallel Streams, Java Concurrency Package, Java Executor, Java ExecutorService, Java Future, Java CompletableFuture, Java ForkJoinPool, Java ReentrantLock, Java Semaphore, Java CountDownLatch, Java CyclicBarrier, Java Phaser, Java BlockingQueue, Java ConcurrentHashMap, Java AtomicInteger, Java AtomicLong, Java AtomicReference, Java AtomicBoolean, Java Lock Interface, Java ReadWriteLock, Java Condition, Java ThreadLocal, Java Synchronized Keyword, Java Volatile Keyword, Java Notify, Java Wait, Java Monitor, Java ReentrantReadWriteLock, Java ConcurrentLinkedQueue, Java PriorityQueue, Java Deque, Java ArrayDeque, Java SortedMap, Java SortedSet, Java NavigableMap, Java NavigableSet, Java EnumSet, Java EnumMap, Java WeakHashMap, Java LinkedHashMap, Java LinkedHashSet, Java IdentityHashMap, Java TreeMap Comparator, Java HashCode, Java Equals Method, Java CompareTo Method, Java Cloneable Interface, Java Serializable Interface, Java Externalizable Interface, Java Serialization Mechanism, Java ObjectOutputStream, Java ObjectInputStream, Java Transient Keyword, Java Persistence, Java JDBC (Java Database Connectivity), Java SQL Package, Java PreparedStatement, Java ResultSet, Java DriverManager, Java Connection, Java Statement, Java CallableStatement, Java RowSet, Java Bean, Java PropertyDescriptor, Java Introspector, Java BeanInfo, Java Enterprise Edition, Java Servlet, Java ServletContext, Java HttpServlet, Java HttpServletRequest, Java HttpServletResponse, Java Session, Java Filter, Java Listener, Java JSP (Java Server Pages), Java Expression Language, Java JSTL (JavaServer Pages Standard Tag Library), Java JDBC RowSet, Java DataSource, Java JNDI (Java Naming and Directory Interface), Java RMI (Remote Method Invocation), Java RMI Registry, Java RMI Stub, Java RMI Skeleton, Java RMI Remote Interface, Java CORBA Support, Java IDL, Java NamingException, Java InitialContext, Java Context Lookup, Java Message Service (JMS), Java Mail API, Java Bean Validation, Java Security Manager, Java Policy, Java Permission, Java AccessController, Java PrivilegedAction, Java KeyStore, Java TrustStore, Java SSLContext, Java Cipher, Java MessageDigest, Java KeyFactory, Java SecretKey, Java PublicKey, Java PrivateKey, Java Certificate, Java SecureRandom, Java SecureClassLoader, Java GSS-API (Generic Security Services), Java SASL (Simple Authentication and Security Layer), Java JAAS (Java Authentication and Authorization Service), Java Kerberos Integration, Java PKI (Public Key Infrastructure), Java JCE (Java Cryptography Extension), Java JCA (Java Cryptography Architecture), Java AWT (Abstract Window Toolkit), Java Swing, Java JFrame, Java JPanel, Java JLabel, Java JButton, Java JTextField, Java JTextArea, Java JScrollPane, Java JList, Java JComboBox, Java JTable, Java JTree, Java JDialog, Java JOptionPane, Java JProgressBar, Java JSlider, Java JSpinner, Java BoxLayout, Java BorderLayout, Java FlowLayout, Java GridLayout, Java GridBagLayout, Java CardLayout, Java LayoutManager, Java Drag and Drop, Java Clipboard, Java ImageIO, Java BufferedImage, Java Graphics2D, Java Font, Java Color, Java GradientPaint, Java TexturePaint, Java Stroke, Java Shape, Java AffineTransform, Java Path2D, Java BasicStroke, Java RenderingHints, Java GraphicsEnvironment, Java Robot, Java PrintService, Java PrinterJob, Java Paint Event, Java SwingUtilities, Java Pluggable LookAndFeel, Java Metal LookAndFeel, Java Nimbus LookAndFeel, Java Accessibility API, Java Sound API, Java MIDI, Java Clip, Java AudioInputStream, Java Sequencer, Java Synthesizer, Java Line, Java Port, Java Mixer, Java DataLine, Java Applet, Java Web Start, Java FX (JavaFX), Java SceneGraph, Java Node (JavaFX), Java Stage (JavaFX), Java Scene (JavaFX), Java Pane (JavaFX), Java GridPane, Java BorderPane, Java HBox, Java VBox, Java StackPane, Java AnchorPane, Java FlowPane, Java TilePane, Java Label (JavaFX), Java Button (JavaFX), Java TextField (JavaFX), Java TextArea (JavaFX), Java ChoiceBox, Java ComboBox (JavaFX), Java ListView, Java TableView, Java TreeView, Java WebView, Java Observable, Java Property (JavaFX), Java Binding (JavaFX), Java CSS (JavaFX), Java FXML, Java MediaPlayer, Java SwingNode, Java HTMLEditor (JavaFX), Java Concurrency in JavaFX, Java ScheduledExecutorService, Java Timer, Java TimerTask, Java ThreadPoolExecutor, Java WorkStealingPool, Java Callable, Java Runnable, Java FutureTask, Java LockSupport, Java Phaser Parties, Java Thread Dump, Java Heap Dump, Java Flight Recorder, Java Mission Control, Java JVMTI (JVM Tool Interface), Java JMX (Java Management Extensions), Java MBean, Java MBeanServer, Java MXBean, Java GarbageCollectorMXBean, Java MemoryMXBean, Java OperatingSystemMXBean, Java ThreadMXBean, Java CompilationMXBean, Java ClassLoadingMXBean, Java PlatformManagedObject, Java Instrumentation API, Java Attach API, Java JVMDebugger, Java JDWP (Java Debug Wire Protocol), Java JDI (Java Debug Interface), Java JShell, Java Scripting API, Java Nashorn (JavaScript Engine), Java XML Processing, Java DOM Parser, Java SAX Parser, Java StAX Parser, Java JAXB (Java Architecture for XML Binding), Java JAXP (Java API for XML Processing), Java SOAP, Java JAX-WS (Java API for XML Web Services), Java RESTful Web Services (JAX-RS), Java JSON Processing (JSON-P), Java JSON Binding (JSON-B), Java CDI (Contexts and Dependency Injection), Java EJB (Enterprise JavaBeans), Java JMS (Java Message Service), Java JTA (Java Transaction API), Java Bean Validation (JSR 380), Java Dependency Injection Frameworks, Java Spring Framework, Java Spring Boot, Java Hibernate (Java Persistence Framework), Java JPA (Java Persistence API), Java JAX-RPC (Java API for XML-based RPC), Java AppServer, Java GlassFish, Java WildFly, Java Liberty Profile, Java Tomcat, Java Jetty, Java Undertow, Java OSGi (Open Service Gateway Initiative), Java Pax Exam, Java RAP (Remote Application Platform), Java RCP (Rich Client Platform), Java Equinox, Java Tycho Build, Java Lombok, Java Guava, Java SLF4J (Simple Logging Facade for Java), Java Logback, Java JUL (Java Util Logging), Java Log4j, Java Commons Collections, Java Commons IO, Java Commons Lang, Java HTTPClient, Java URLConnection, Java URI Class, Java URL Class, Java Cookie Handler, Java HTTPServer, Java WebSocket API, Java AppletViewer, Java RMIClassLoader, Java JVMPauseDetector, Java Memory Settings, Java System Properties, Java Environment Variables (As Accessed by Java), Java ServiceLoader, Java SPI (Service Provider Interface), Java Instrumentation Rewriting, Java Agent Attaching, Java Runtime Exec, Java ProcessHandle, Java ProcessBuilder, Java ScriptingEngineManager, Java ScriptEngine, Java ScriptContext, Java CompiledScript, Java FX Application Thread, Java FXProperty, Java FXObservableValue, Java FXKeyFrame, Java FXTimeline, Java FXTransition, Java FXImageView, Java FXCanvas, Java FX3D Features, Java AOT Compilation (jaotc), Java GraalVM Integration, Java JNI (Java Native Interface), Java NIO (Non-Blocking I/O), Java Path, Java Files Class, Java FileSystem, Java FileChannel, Java AsynchronousFileChannel, Java Socket, Java ServerSocket, Java DatagramSocket, Java MulticastSocket, Java SocketChannel, Java ServerSocketChannel, Java DatagramChannel, Java Pipe, Java FileLock, Java MappedByteBuffer, Java CharsetDecoder, Java CharsetEncoder, Java SecretKeySpec, Java KeySpec, Java KeyPair, Java KeyAgreement, Java KeyGenerator, Java Mac (Message Authentication Code), Java PolicySpi, Java SecureRandomSpi, Java CertPath, Java CertPathBuilder, Java CertPathValidator, Java TrustManager, Java KeyManager, Java SSLSession, Java SSLSocket, Java SSLServerSocket, Java SSLEngine, Java SSLParameters, Java HttpsURLConnection, Java DomainCombiner, Java Principal, Java Subject, Java LoginContext, Java CallbackHandler, Java TextField (Swing), Java TextPane, Java StyledDocument, Java AttributeSet, Java StyleConstants, Java AbstractDocument, Java DocumentFilter, Java Caret, Java Highlighter, Java UndoManager, Java DefaultStyledDocument, Java ViewFactory, Java EditorKit, Java KeyStroke, Java ActionMap, Java InputMap, Java RootPane, Java GlassPane, Java LayeredPane, Java MenuBar, Java MenuItem, Java JMenu, Java JMenuItem, Java JCheckBoxMenuItem, Java JRadioButtonMenuItem, Java PopupMenu, Java Popup, Java TooltipManager, Java DesktopManager, Java InternalFrame, Java InternalFrameUI, Java InternalFrameAdapter, Java DockingFrames, Java SystemTray, Java TrayIcon, Java Robot Class, Java PrintServiceLookup, Java FlavorMap, Java Transferable, Java DataFlavor, Java DragGestureRecognizer, Java DropMode, Java DropTargetAutoScroll, Java DropTargetContext, Java DropTargetListener, Java DropTargetDragEvent, Java DropTargetDropEvent, Java BasicLookAndFeel Class, Java SynthLookAndFeel, Java UIDefaults, Java UIManager, Java ClientPropertyKey, Java ImageIOSpi, Java ImageWriter, Java ImageReader, Java ImageInputStream, Java ImageOutputStream, Java IIOMetadata, Java BufferedImageOp, Java ColorModel, Java WritableRaster, Java IndexColorModel, Java Raster, Java RenderedImage, Java WritableRenderedImage, Java ImageTranscoder, Java ImageWriterSpi, Java ImageReaderSpi, Java Soundbank, Java MidiChannel, Java MidiDevice, Java MidiEvent, Java Sequence, Java MidiFileFormat, Java SoundFont, Java AudioSystem, Java AudioFormat, Java DataLine.Info, Java LineEvent, Java LineListener, Java Clip Class, Java SourceDataLine, Java TargetDataLine, Java Port.Info, Java Mixer.Info, Java Gervill (SoftSynthesizer), Java AccessBridge, Java AWTEvent, Java KeyEvent, Java MouseEvent, Java FocusEvent, Java WindowEvent, Java ComponentEvent, Java AdjustmentEvent, Java ContainerEvent, Java InputMethodEvent, Java HierarchyEvent, Java InvocationEvent, Java PaintEvent, Java DropTargetEvent, Java Peer Interface, Java AWTEventMulticaster, Java Toolkit, Java Desktop, Java GraphicsConfiguration, Java GraphicsDevice, Java AWTKeyStroke, Java TextHitInfo, Java TextLayout, Java TextAttribute, Java FontRenderContext, Java AttributedString, Java LineBreakMeasurer, Java Bidi, Java BreakIterator, Java Collator, Java Locale, Java ResourceBundle, Java Formatter, Java Format Conversion, Java SimpleDateFormat, Java DecimalFormat, Java MessageFormat, Java ChoiceFormat, Java ScannerDelimiter, Java System.Logger, Java Logger, Java Level, Java LogRecord, Java ConsoleHandler, Java FileHandler, Java MemoryHandler, Java SocketHandler, Java SimpleFormatter, Java XMLFormatter, Java Preferences, Java PreferenceChangeEvent, Java NodeChangeEvent, Java PrinterException, Java PrinterAbortException, Java PrintException, Java PrintQuality, Java PrintServiceAttribute, Java ServiceUI, Java Pageable, Java Printable, Java Book, Java TablePrintable, Java StreamPrintService, Java StreamPrintServiceFactory, Java Filer (Annotation Processing), Java Messager, Java ProcessingEnvironment, Java Element, Java ElementKind, Java ElementVisitor, Java PackageElement, Java TypeElement, Java VariableElement, Java ExecutableElement, Java AnnotationMirror, Java AnnotationValue, Java AnnotationProcessor, Java RoundEnvironment, Java TypeMirror, Java DeclaredType, Java ArrayType, Java TypeVariable, Java WildcardType, Java NoType, Java ErrorType, Java UnionType, Java IntersectionType, Java JavacTool, Java StandardJavaFileManager, Java Diagnostic, Java DiagnosticCollector, Java ForwardingJavaFileManager, Java ForwardingJavaFileObject, Java ForwardingJavaFileObject, Java SPI ServiceLoader, Java ToolProvider, Java DocumentationTool, Java JavaCompiler, Java JShellTool, Java DiagnosticListener, Java CompilationTask, Java ModuleElement, Java ModuleLayer, Java ModuleDescriptor, Java ModuleFinder
OLD before GPT Pro: Abstract Classes, Abstract Methods, Abstract Window Toolkit, Access Control Exception, Access Modifiers, Accessible Object, AccessController Class, Action Event, Action Listener, Action Performed Method, Adapter Classes, Adjustment Event, Adjustment Listener, Annotation Processing Tool, Annotations, AnnotationTypeMismatchException, Anonymous Classes, Applet Class, Applet Context, Applet Lifecycle Methods, Application Class Data Sharing, Array Blocking Queue, Array Index Out of Bounds Exception, Array List, Array Store Exception, Arrays Class, Assertion Error, Assertions, Assignment Operator, Asynchronous File Channel, Atomic Boolean, Atomic Integer, Atomic Long, Atomic Reference, Attribute Set, Audio Clip, Authentication Mechanisms, Auto Closeable Interface, Auto Boxing, AWT Components, AWT Event Queue, AWT Listeners, AWT Toolkit, Backing Store, Background Compilation, Batch Updates, Bean Context, Bean Descriptors, Bean Info, Big Decimal Class, Big Integer Class, Binary Compatibility, Binding Utilities, Bit Set Class, Bitwise Operators in Java, Blocking Queue Interface, Boolean Class, Bounded Wildcards, Breakpoint, Buffered Input Stream, Buffered Output Stream, Buffered Reader, Buffered Writer, BufferOverflowException, BufferUnderflowException, Button Class, Byte Array Input Stream, Byte Array Output Stream, Byte Order, ByteBuffer Class, Bytecode Instructions, Bytecode Verifier, Callable Interface, Callable Statement, Calendar Class, Canvas Class, Card Layout, Caret Listener, Case Sensitivity in Java, Casting in Java, Catch Block, Certificate Exception, Character Class, Character Encoding, Character Set, Character.UnicodeBlock, Charset Class, Checked Exceptions, Checkbox Class, Choice Component, Class Class, Class Files, Class Loader, Class Loader Hierarchy, Class Loading Mechanism, Class Not Found Exception, Class Object, Class Path, ClassCastException, ClassCircularityError, ClassFormatError, ClassLoader, ClassNotFoundException, Clone Method, CloneNotSupportedException, Cloneable Interface, Clipboard Class, Cloneable Interface, ClosedChannelException, Collections Framework, Collections Utility Class, Collector Interface, Collectors Class, Color Class, Column Major Order, Comparable Interface, Comparator Interface, Compiler API, Compiler Directives, Compiler Optimization, Component Class, Component Event, Component Listener, Composite Pattern, ConcurrentHashMap, ConcurrentLinkedQueue, ConcurrentModificationException, ConcurrentNavigableMap, ConcurrentSkipListMap, ConcurrentSkipListSet, Condition Interface, Connection Interface, Console Class, Constructor Overloading, Consumer Interface, Container Class, ContainerEvent, Content Handler, ContentHandlerFactory, Context Class Loader, Continue Statement, Control Flow Statements, CountDownLatch Class, CRC32 Class, Credential Management, Critical Section, CyclicBarrier Class, Daemon Threads, Data Class, Data Input Interface, Data Input Stream, Data Output Interface, Data Output Stream, Data Truncation Exception, Date Class, Daylight Saving Time Handling, Deadlock in Java, Debugging Techniques, DecimalFormat Class, Default Methods in Interfaces, Deflater Class, Deprecated Annotation, Design Patterns in Java, Desktop Class, Diamond Operator, Dialog Class, Dictionary Class, DigestInputStream, DigestOutputStream, Direct Byte Buffer, DirectoryStream Interface, Document Object Model, DOM Parsing in Java, Double Brace Initialization, Double Class, Drag and Drop API, Driver Manager, Drop Shadow Effect, Dynamic Binding, Dynamic Proxy Classes, Element Interface, Ellipse2D Class, EmptyStackException, Encapsulation in Java, Enum Classes, Enum Constant, EnumSet Class, Enumeration Interface, EOFException, Error Handling in Java, Error Prone Practices, Event Delegation Model, Event Handling Mechanism, Event Listener Interfaces, Event Object, Event Queue, EventQueue Class, Exception Chaining, Exception Handling Mechanism, Executable Jar Files, Executor Interface, Executor Service, Executors Class, Expression Evaluation, Extends Keyword, Externalizable Interface, File Class, File Channel, File Descriptor, File Filter Interface, File Input Stream, File Lock Mechanism, File Output Stream, File Permission, File Reader, File Writer, FileDialog Class, FilenameFilter Interface, FileNotFoundException, Final Classes, Final Keyword, Finally Block, Finalize Method, Finalizer Guardian Idiom, Float Class, Flow Layout, Flow API, Focus Listener, Font Class, For Each Loop, ForkJoinPool Class, Formatter Class, Frame Class, Functional Interfaces, Future Interface, FutureTask Class, Garbage Collection Mechanism, Garbage Collector, Generics in Java, Generic Methods, Generic Types, Geometry Classes, Glyph Vector, GradientPaint Class, Graphics Class, Graphics2D Class, Grid Bag Constraints, Grid Bag Layout, Grid Layout, GregorianCalendar Class, Group Layout, GUI Components in Java, GZIPInputStream, GZIPOutputStream, Hash Collision, Hash Function, Hash Map Class, Hash Set Class, Hashtable Class, HashCode Method, Headless Exception, Heap Memory, Hello World Program in Java, Hierarchical Inheritance, High-Level Concurrency API, HTTP Client in Java, HTTP Server in Java, Icon Interface, Identifier Naming Convention, If Statement, IllegalArgumentException, IllegalMonitorStateException, IllegalStateException, IllegalThreadStateException, Image Class, ImageIcon Class, Immutable Classes, Import Statement, InaccessibleObjectException, Inheritance in Java, InitialContext Class, Inner Classes, Input Method Framework, Input Stream, InputStreamReader Class, Instance Initializer Block, Instance Variables, InstantiationException, Integer Class, Integer Overflow and Underflow, InterruptedException, InterruptedIOException, Interface in Java, InternalError, Internationalization, IO Exception, IO Streams in Java, Iterable Interface, Iterator Interface, Jar Entry, Jar File, JarInputStream Class, JarOutputStream Class, Java Access Bridge, Java Annotations, Java API Documentation, Java Applets, Java Archive (JAR), Java Beans, Java Bytecode, Java Class Library, Java Collections Framework, Java Community Process, Java Compiler, Java Database Connectivity (JDBC), Java Development Kit (JDK), Java Documentation Comments, Java Flight Recorder, Java Garbage Collector, Java Generics, Java Memory Model, Java Native Interface (JNI), Java Naming and Directory Interface (JNDI), Java Network Launching Protocol (JNLP), Java Platform, Java Plugin, Java Reflection API, Java Remote Method Invocation (RMI), Java Runtime Environment (JRE), Java Security Manager, Java Serialization, Java Server Pages (JSP), Java Stream API, Java Swing, Java Virtual Machine (JVM), Java Web Start, JavaFX Platform, javax Package, Javadoc Tool, JAR Signing Mechanism, JDBC API, JDBC Drivers, JFrame Class, JIT Compiler, JLabel Class, JLayeredPane Class, JList Component, JMenu Component, JOptionPane Class, JPanel Class, JPasswordField Component, JProgressBar Component, JScrollBar Component, JScrollPane Component, JSeparator Component, JSlider Component, JSplitPane Component, JTabbedPane Component, JTable Component, JTextArea Component, JTextField Component, JTextPane Component, JToolBar Component, JTree Component, JVM Arguments, JVM Memory Model, Key Event, Key Listener Interface, Key Stroke Class, KeyException, KeySpec Interface, Keyword in Java, Label Class, Lambda Expressions in Java, Layout Manager, LayoutManager2 Interface, Lazy Initialization, Leaf Nodes, Legacy Classes in Java, LineNumberReader Class, Linked Blocking Queue, Linked Hash Map, Linked Hash Set, Linked List Class, List Interface, List Iterator Interface, Listener Interfaces in Java, Load Factor in HashMap, Locale Class, Lock Interface, Logger Class, Logging API in Java, Long Class, Main Method in Java, MalformedURLException, Map Interface, Map.Entry Interface, Marker Interface, Math Class, Media Tracker, Memory Leak in Java, Memory Management in Java, Menu Class, Message Digest, Method Chaining, Method Overloading, Method Overriding, Methods in Java, MIDI Devices in Java, Mouse Adapter Class, Mouse Event, Mouse Listener Interface, Multi-Catch Exception, Multi-Level Inheritance, Multicast Socket, Multidimensional Arrays, Mutable Objects in Java, Naming Convention in Java, Native Methods, Navigable Map, Navigable Set, Nested Classes in Java, Network Interface Class, NoClassDefFoundError, NoSuchFieldException, NoSuchMethodException, Non-Blocking IO (NIO), Null Pointer Exception, Number Class, Number Format Exception, NumberFormat Class, Object Class, Object Cloning, Object Input Stream, Object Oriented Programming, Object Output Stream, Object Serialization in Java, Observer Pattern, Observable Class, OpenGL in Java, Optional Class, OutOfMemoryError, Override Annotation, Package Declaration, Packages in Java, Paint Interface, Panel Class, Parallel Garbage Collector, Parameter Passing in Java, ParseException, Path Interface, Pattern Class, Piped Input Stream, Piped Output Stream, PixelGrabber Class, Point Class, Polymorphism in Java, Prepared Statement, Primitive Data Types in Java, PrintStream Class, PrintWriter Class, Priority Blocking Queue, Priority Queue Class, Private Access Modifier, Process Class, Process Builder Class, Progress Monitor Class, Properties Class, Protected Access Modifier, Proxy Class, Public Access Modifier, Queue Interface, RadioButton Class, Random Access File, Reader Class, ReadWriteLock Interface, Rectangle Class, Recursive Methods, Reflection API in Java, Reference Queue, Regular Expressions in Java, Remote Method Invocation (RMI), Render Quality, Repeatable Annotations, Resource Bundle Class, Resource Leak in Java, ResultSet Interface, ResultSetMetaData Interface, Retry Logic in Java, Return Statement in Java, Runnable Interface, Runtime Class, Runtime Error, Runtime Exception, Runtime Permissions, Runtime Polymorphism, Scanner Class, Scheduling in Java, Script Engine, Scroll Bar Component, Scroll Pane Component, Security Exception, Security Manager, Semaphore Class, Sequence Input Stream, Serializable Interface, ServerSocket Class, Service Loader, Set Interface, Setter Methods, Shared Memory in Java, Short Class, Single Inheritance, Singleton Pattern in Java, Socket Class, SocketTimeoutException, Sorted Map, Sorted Set, Splash Screen, Spring Framework, SQLException, SSL Socket, Stack Class, StackOverflowError, Standard Edition of Java, StandardOpenOption, Statement Interface, StreamTokenizer Class, Strictfp Keyword, String Buffer Class, String Builder Class, String Class, String Constant Pool, StringIndexOutOfBoundsException, String Interning, String Literal in Java, String Pool in Java, String Tokenizer Class, Strong Typing in Java, Structural Patterns, Stub Class, Subclasses in Java, Superclass in Java, Supplier Interface, Support Classes, Swing Components, Swing Timer, Switch Statement in Java, Synchronized Block, Synchronized Method, System Class, System Properties in Java, Tab Pane Component, Table Model Interface, TCP Connection in Java, Template Method Pattern, Text Area Component, Text Field Component, Text Listener Interface, Thread Class, Thread Group, Thread Interruption, Thread Local Class, Thread Priority, Thread Safety in Java, Thread Scheduling, Throwable Class, Time Zone Class, Timer Class, Timer Task Class, Toolkit Class, ToolTip Manager, Transferable Interface, Transient Keyword, Tree Map Class, Tree Set Class, Try With Resources Statement, Type Erasure in Java, Type Inference in Java, Type Parameters, UI Manager Class, Unary Operator Interface, Unchecked Exceptions, UndeclaredThrowableException, Unicode Support in Java, Unmodifiable Collection, Unsafe Class, URL Class, URLConnection Class, URLDecoder Class, URLEncoder Class, URLStreamHandler Class, URLClassLoader Class, User Interface Components, Varargs in Java, Variable Arguments, Variable Scope in Java, Vector Class, Vendor-Specific Extensions, Viewport Class, Virtual Machine in Java, Volatile Keyword, Wait and Notify Methods, Weak Hash Map, Weak Reference, While Loop in Java, Wildcard Generic Types, Window Adapter Class, Window Event, Window Listener Interface, Wrapper Classes in Java, Write Once Run Anywhere, XML Binding in Java, XML Parsing in Java, XML Schema in Java, XPath Expression in Java, XSLT Transformation in Java, Yield Method in Thread, Zip Entry, Zip File, Zip Input Stream, Zip Output Stream, ZoneId Class, ZoneOffset Class
Java: Java Best Practices (Effective Java), Java Fundamentals, Java Inventor - Java Language Designer: James Gosling of Sun Microsystems, Java Docs, JDK, JVM, JRE, Java Keywords, JDK 17 API Specification, java.base, Java Built-In Data Types, Java Data Structures - Java Algorithms, Java Syntax, Java OOP - Java Design Patterns, Java Installation, Java Containerization, Java Configuration, Java Compiler, Java Transpiler, Java IDEs (IntelliJ - Eclipse - NetBeans), Java Development Tools, Java Linter, JetBrains, Java Testing (JUnit, Hamcrest, Mockito), Java on Android, Java on Windows, Java on macOS, Java on Linux, Java DevOps - Java SRE, Java Data Science - Java DataOps, Java Machine Learning, Java Deep Learning, Functional Java, Java Concurrency, Java History,
Java Bibliography (Effective Java, Head First Java, Java - A Beginner's Guide by Herbert Schildt, Java Concurrency in Practice, Clean Code by Robert C. Martin, Java - The Complete Reference by Herbert Schildt, Java Performance by Scott Oaks, Thinking in Java, Java - How to Program by Paul Deitel, Modern Java in Action, Java Generics and Collections by Maurice Naftalin, Spring in Action, Java Network Programming by Elliotte Rusty Harold, Functional Programming in Java by Pierre-Yves Saumont, Well-Grounded Java Developer, Second Edition, Java Module System by Nicolai Parlog), Manning Java Series, Java Glossary - Glossaire de Java - French, Java Topics, Java Courses, Java Security - Java DevSecOps, Java Standard Library, Java Libraries, Java Frameworks, Java Research, Java GitHub, Written in Java, Java Popularity, Java Awesome List, Java Versions. (navbar_java and navbar_java_detailed - see also navbar_jvm, navbar_java_concurrency, navbar_java_standard_library, navbar_java_libraries, navbar_java_best_practices, navbar_openjdk, navbar_java_navbars, navbar_kotlin)
Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers
SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.