Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to pass in a Double number(class) into a sum class' constructor. I tried passing in an ArrayList of numbers . Basically the class

I need to pass in a Double number(class) into a sum class' constructor. I tried passing in an ArrayList of numbers . Basically the class sum can pass in any number of number objects. Need help building a versatile constructor such that sum can take in at least two number objects. Then the sum class need to add all of the number objects. (JAVA)

Basically the sum constructor can take any number of double:

//Constructor

class sum(num(obj), num(obj)){

}

method add(List){

iterate through all the number objects and print out the sum

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

What changes, if any, are projected for this environment?

Answered: 1 week ago

Question

How have these groups changed within the last three years?

Answered: 1 week ago