Question: So if I have two objects from the main class and I ' m trying to add them together. how can I create a
So if I have two objects from the main class and Im trying to add them together. how can I create a method to add whatever those two objects?
MA
I tried to do it here but I could not finish it
package Bright;
public class partic
public int conNumber;
public particint number
conNumber number;
public partic addpartic sum
return null;
package Bright;
public class particDemo
public static void main String args
partic val new partic;
System.out.printlnval one is valconNumber;
partic val new partic;
System.out.printlnval one is valconNumber;
partic sum;
sum valaddval;
System.out.printlnThe sum: sum;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
