Starting from:

$25

JAC444-Workshop 6 Solved

This assignment lets you practice basic Functional Programming and Lambda Expressions in Java. 

 

In this assignment, you will be adding some code to the workshop 2 (shapes) as follows:

Task 4: Define a functional interface to calculate the area of a shape. Create an object of that interface in each of the Circle, Square, Rectangle classes, using lambda expressions.

 

Print all the shapes and their perimeters polymorphically, as you did in task 1 (don’t forget that you are using just one Shape array) but in cases that the shape being printed is an object of these classes (i.e. Circle, Square, Rectangle), print their areas (using the above mentioned objects you created) as well.

More products