0

What operand i Can Do for my two object variable ? I have error in my code. Thanks you.

Operand? https://code.sololearn.com/cVpX0x0M1t74/?ref=app

22nd Sep 2020, 5:57 AM
Malick Diagne
Malick Diagne - avatar
2 Réponses
+ 1
public class Program { public static void main(String[] args) { Int myint1 = new Int (5) ; Int myint2 = new Int (5); System.out.println (myint1.number + myint2.number); } } class Int { int number; Int (int mynumber){ this.number = mynumber ; } }
22nd Sep 2020, 6:06 AM
Avinesh
Avinesh - avatar
0
Put "Public"int number in your class INT.
22nd Sep 2020, 12:29 PM
Pon Balaji
Pon Balaji - avatar