File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
manifold-deps-parent/manifold-params Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ valueOf(array, count:20) // use default for offset by naming count
2121
2222This plugin supports JDK versions 8 - 21 (and the latest) and integrates seamlessly with ** IntelliJ IDEA** and ** Android Studio** .
2323
24+ ### Key Features
25+ - ** Optional Parameters** : Define default values for method parameters
26+ - ** Named Arguments** : Pass arguments by name, not just by position
27+ - ** Binary Compatible** : Works seamlessly with legacy code
2428
2529# Contents
2630
@@ -100,7 +104,7 @@ record Pizza(Size size,
100104In this case, named arguments make it clear which values are being assigned to which parameters, improving the overall
101105readability of the code.
102106
103- You can also mix positional and named arguments, but named arguments must come after positional arguments.
107+ You can also reorder named arguments and mix positional and named arguments, but named arguments must come after positional arguments.
104108``` java
105109new Pizza (Large , cheese: Fresco , sauce: Chili );
106110```
@@ -196,12 +200,14 @@ cautiously to prevent unintended side effects.
196200Optional parameters and named arguments are fully accessible from compiled .class files , just like source code.
197201```java
198202// .class file
203+
199204public class MyClass {
200205 public void size (int width , int height = width ) {... }
201206}
202207```
203208```java
204209// .java file
210+
205211MyClass myClass = new MyClass ();
206212myClass.size (width :100 );
207213```
You can’t perform that action at this time.
0 commit comments