Skip to content

Commit

Permalink
Optional Named Parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
smartherd committed Jun 27, 2018
1 parent e1bb5dd commit 5a25868
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions 16_named_parameters.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

// Optional Named Parameters

void main() {
findVolume(10, breadth: 5, height: 20);
print("");

findVolume(10, height: 20, breadth: 5); // Sequence doesn't matter in Named Parameter
}


int findVolume(int length, {int breadth, int height}) {

print("Length is $length");
print("Breadth is $breadth");
print("Height is $height");

print("Volume is ${length * breadth * height}");
}

0 comments on commit 5a25868

Please sign in to comment.