From 4e8e629042b28f7b8fb6f3f5747d74aaeeb0c4c0 Mon Sep 17 00:00:00 2001 From: scott Date: Mon, 27 Jan 2025 15:57:41 -0500 Subject: [PATCH] doc changes --- manifold-deps-parent/manifold-params/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/manifold-deps-parent/manifold-params/README.md b/manifold-deps-parent/manifold-params/README.md index 9e616c8f5..3d07e65bd 100644 --- a/manifold-deps-parent/manifold-params/README.md +++ b/manifold-deps-parent/manifold-params/README.md @@ -21,6 +21,10 @@ valueOf(array, count:20) // use default for offset by naming count This plugin supports JDK versions 8 - 21 (and the latest) and integrates seamlessly with **IntelliJ IDEA** and **Android Studio**. +### Key Features +- **Optional Parameters**: Define default values for method parameters +- **Named Arguments**: Pass arguments by name, not just by position +- **Binary Compatible**: Works seamlessly with legacy code # Contents @@ -100,7 +104,7 @@ record Pizza(Size size, In this case, named arguments make it clear which values are being assigned to which parameters, improving the overall readability of the code. -You can also mix positional and named arguments, but named arguments must come after positional arguments. +You can also reorder named arguments and mix positional and named arguments, but named arguments must come after positional arguments. ```java new Pizza(Large, cheese:Fresco, sauce:Chili); ``` @@ -196,12 +200,14 @@ cautiously to prevent unintended side effects. Optional parameters and named arguments are fully accessible from compiled .class files, just like source code. ```java // .class file + public class MyClass { public void size(int width, int height = width) {...} } ``` ```java // .java file + MyClass myClass = new MyClass(); myClass.size(width:100); ```