Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started