Question: Java Code: a. Function that gets 3 lengths and widths and calculates areas and store them in an array b. make the arrays pass by

Java Code:

a. Function that gets 3 lengths and widths and calculates areas and store them in an array

b. make the arrays pass by reference (instead of return it)

I know how to do this in python but I just started java and I'm kind of not good at, so in python I would have something like this:

def main():

for i in range(3):

width = int(input("Enter width integer: "))

length = int(input("Enter length: "))

area = width * length

print(area)

main()

I don't quite understand the pass by reference so i didn't put that in the above code. but can you explain that python code in java please so I can understand it better.

also if you can explain a little bit of pass by reference.

Thank you!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!