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
21
21
22
22
This plugin supports JDK versions 8 - 21 (and the latest) and integrates seamlessly with ** IntelliJ IDEA** and ** Android Studio** .
23
23
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
24
28
25
29
# Contents
26
30
@@ -100,7 +104,7 @@ record Pizza(Size size,
100
104
In this case, named arguments make it clear which values are being assigned to which parameters, improving the overall
101
105
readability of the code.
102
106
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.
104
108
``` java
105
109
new Pizza (Large , cheese: Fresco , sauce: Chili );
106
110
```
@@ -196,12 +200,14 @@ cautiously to prevent unintended side effects.
196
200
Optional parameters and named arguments are fully accessible from compiled .class files , just like source code.
197
201
```java
198
202
// .class file
203
+
199
204
public class MyClass {
200
205
public void size (int width , int height = width ) {... }
201
206
}
202
207
```
203
208
```java
204
209
// .java file
210
+
205
211
MyClass myClass = new MyClass ();
206
212
myClass.size (width :100 );
207
213
```
You can’t perform that action at this time.
0 commit comments