Skip to content
bbminfo – Learn from Scratch
Subjects Code examples Library reference
Computer Programming Python Java C++ C Go PHP Kotlin Ruby R Scala Groovy Rust Dart Mojo Zig Julia Swift C# JavaScript TypeScript

Tutorial menu

Subjects

Computer Programming MathsPlanned ChemistryPlanned

Lesson contents

Programming resources

All languages Code examples Library reference

Programming languages

Python Java C++ C Go PHP Kotlin Ruby R Scala Groovy Rust Dart 🔥 Mojo Zig Julia Swift C# JavaScript TypeScript
Tutorials/Computer Programming/Java/Examples

Java programming examples

Run Java examples that swap numbers, check palindromes, and use the standard library for dates, files, collections and asynchronous results.

Swap two numbersExchange the values of two variables and check the result. Check for a palindromeCompare a value with its reverse to see whether it reads the same both ways.

Java library examples

  • Build and inspect an HTTP request
  • Calculate a renewal across February
  • Combine two independent subtotals
  • Count XML records by element name
  • Count characters in a shipping label
  • Decode an unsigned two-byte count
  • Decode the insertion point of a missing key
  • Describe a JDBC row without a database
  • Detect overflow before recording a total
  • Distinguish a zero price from a missing price
  • Extract invoice numbers with a named group
  • Find a maximum when a stream may be empty
  • Group successful orders by customer
  • Handle a full work queue
  • Preserve empty fields in an order record
  • Read the channels of a pixel
  • Recover a failed asynchronous result
  • Round an invoice tie in cents
  • Round-trip a Unicode label through Base64
  • Round-trip a compressed report
  • Sort and compare text with an explicit locale
  • Test a deadline at the exact cutoff
Advertisements
bbminfo – Learn from Scratch
© 2026 bbminfoArtwork creditsPrivacy policy