CodeGym
Promotion
CodeGym University
Java FullStack
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • Compression and profiling of serialization

    JAVA 25 SELF
    Level 45, Lesson 4
    How to reduce size and speed up object serialization in Java: exclude unnecessary fields with transient, take full control via Externalizable, apply stream compression ( GZIPOutputStream, ZipOutputStream), accelerate I/O with buffering ( BufferedOutputStream, BufferedInputStream) and fast copying via FileChannel. transferTo. To assess performance, use both quick measurements with System. nanoTime(), and reliable microbenchmarks on JMH. We’ll finish with a mini experiment and a review of common mistakes.
    Available
  • JSON basics: structure, syntax, advantages

    JAVA 25 SELF
    Level 46, Lesson 0
    A concise, modern introduction to the JSON data interchange format: what it is and why it became the de facto standard for REST API; basic structures — objects { } and arrays [ ]; allowed types (strings "...", numbers, boolean values true/ false, null); nesting; comparison with XML; JSON ↔ Java mappings (collections Map<K, V>, HashMap<K, V>). We go through practical examples and common mistakes: single quotes, trailing commas, undefined, numbers with leading zeros.
    Available
  • Jackson — reading and writing JSON, annotations

    JAVA 25 SELF
    Level 46, Lesson 1
    Jackson is the de facto standard for working with JSON in Java: from simple serialization and deserialization via ObjectMapper to fine-tuning with annotations like @JsonProperty, @JsonIgnore, @JsonInclude, @JsonFormat. In this lecture, we’ll cover adding the dependency ( jackson-databind), reading and writing objects and collections, pretty-printing, working with dates, and common pitfalls, including generics with TypeReference and POJO requirements (no-args constructor, getters/setters).
    Available
  • Gson — serialization and deserialization, configuration

    JAVA 25 SELF
    Level 46, Lesson 2
    In this lecture we examine Google’s Gson library: a quick start with toJson/ fromJson, collection deserialization via TypeToken<>, flexible configuration with GsonBuilder ( setPrettyPrinting, serializeNulls, setDateFormat). We will cover the annotations @SerializedName, @Expose, versioning with @Since/ @Until, custom adapters using TypeAdapter and registerTypeAdapter, then compare it with Jackson and go through common pitfalls.
    Available
  • Working with dynamic structures: Map, List, JsonNode

    JAVA 25 SELF
    Level 46, Lesson 3
    When a JSON structure is unknown beforehand or changes frequently, it’s more convenient to work not with rigid Java classes but with universal containers: Map, List, and JSON trees. In this lecture, we cover how to use ObjectMapper to read data into Map<String, Object> and List, how to safely traverse a tree via JsonNode and its methods get/ path/ asText(), as well as an alternative using Gson with JsonElement, JsonObject, JsonArray. We finish with a hands-on configuration extraction and a review of common mistakes.
    Available
  • JSON validation: JSON Schema, validation errors

    JAVA 25 SELF
    Level 46, Lesson 4
    Why and how to validate incoming JSON before deserialisation: define a data contract with JSON Schema (keys type, properties, required, format), validate in Java using the everit-org/json-schema library (load a schema into Schema, call validate), handle ValidationException properly, and produce clear error messages for users and APIs.
    Available
  • XML basics and namespaces

    JAVA 25 SELF
    Level 47, Lesson 0
    A short, practical introduction to XML: basic structure (elements, attributes, text nodes, comments, CDATA), what the prolog is, and most importantly — why namespaces are needed and how to declare and use them via the xmlns and xmlns:prefix attributes. We’ll unpack prefixes, the default namespace ( xmlns= "URI"), mixing different “vocabularies” in one document, and typical parsing mistakes.
    Available
  • Working with DOM and SAX: XML parsing

    JAVA 25 SELF
    Level 47, Lesson 1
    In this lecture, we cover two classic approaches to parsing XML: the tree-based DOM and the event-driven SAX. You will learn to read and modify documents via the tree ( Document, Element, NodeList) and to process large files in a streaming manner with event handlers ( SAXParser, DefaultHandler, startElement/ characters/ endElement). We will show the pros and cons of each approach, practical examples, and discuss common pitfalls (memory, text splitting in characters, attempts to modify XML in SAX).
    Available
  • StAX (Streaming API for XML) — streaming parsing

    JAVA 25 SELF
    Level 47, Lesson 2
    Breaking down XML streaming parsing with StAX: how the pull model differs from the SAX push approach, how to create a parser via XMLInputFactory and read events from XMLStreamReader in a loop with reader. next() calls, what event types exist ( START_ELEMENT, CHARACTERS, END_ELEMENT, END_DOCUMENT), and when StAX is preferable to DOM/ SAX. Plus: a comparison table, a Mermaid diagram, and a review of common mistakes (stream leaks, element nesting, exceptions XMLStreamException, IOException).
    Available
  • Working with XML via JAXB: basics and annotations

    JAVA 25 SELF
    Level 47, Lesson 3
    How to use JAXB (Jakarta XML Binding) to convert Java objects to XML and back: key annotations @XmlRootElement, @XmlElement, @XmlAttribute, @XmlType, @XmlTransient; core classes JAXBContext, Marshaller, Unmarshaller; formatting via the property Marshaller.JAXB_FORMATTED_OUTPUT. We cover Maven dependencies for Java 11+ ( jakarta.xml.bind-api, jaxb-runtime), working with collections and nested objects, controlling element order ( propOrder), excluding fields, and common pitfalls.
    Available
  • Configuring XML Serialization: Custom Adapters

    JAVA 25 SELF
    Level 47, Lesson 4
    How to teach JAXB to serialize “non-standard” types and present data in the required format: use the @XmlJavaTypeAdapter annotation and write custom adapters based on XmlAdapter<ValueType, BoundType>. We’ll cover date formatting ( LocalDate → "dd.MM.yyyy"), numbers ( BigDecimal), working with collections, moving values into attributes via @XmlAttribute, elements via @XmlElement, and excluding fields with @XmlTransient. We’ll practice serializing/deserializing via Marshaller/ Unmarshaller and go through common pitfalls.
    Available
  • Lambda expressions: syntax, scopes

    JAVA 25 SELF
    Level 48, Lesson 0
    We review and dive deeper into lambda expressions in Java: syntax (parameters, the arrow ->, body), concise forms without parentheses and return, relationship with functional interfaces ( Comparator, Runnable, Consumer), everyday examples with lists, threads, and the Stream API. We cover scope and the “effectively final” rule, the difference in this between lambdas and anonymous classes, as well as common mistakes and how to avoid them.
    Available
  • 1
  • ...
  • 20
  • 21
  • 22
  • 23
  • 24
  • ...
  • 30
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym