toUpperCase
The String method that returns a new string with every letter converted to capitals.
In more detail
Strings are immutable, so the original is unchanged. The course uses it as a simple transformation in streams, Optional and CompletableFuture examples, which is why their output appears in capitals.
Example
"ready".toUpperCase() // "READY"Related terms
- string — A sequence of characters, that is, a piece of text.
- method reference — A compact way to pass an existing method as a function, written Type::method, such as String::toUpperCase or User::active.
Taught in
- Pattern Matching And Text Blocks — Modern Java: Virtual Threads & High-Throughput Services
- The Streams API — Modern Java: Virtual Threads & High-Throughput Services
- Handling Nulls With Optional — Modern Java: Virtual Threads & High-Throughput Services
- Async With CompletableFuture — Modern Java: Virtual Threads & High-Throughput Services
- Strings, StringBuilder And Text Blocks — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep
- Mock Exam: Sit It, Score It — Oracle Certified Professional: Java SE 21 Developer (1Z0-830) Exam Prep