writing a method with object parameters
im writing a class that performa arithmetic on weights, im trying to write a method that adds two weight objects together (in my case the weights are in pounds and ounces so the method itself will add the pounds and ounces individually but i want to parse 2 weight objects to the method
what wil the mthod delcartion be to write such a method?
public ? addWeights(Weights w1, Weights w2){
//implementation
}
//called from a test program
Weights w1 = new Weights(13, 12)
Weights w2 new Weights(10, 3)
addWeights(w1, w2)
pelase help