0
[Solved] Why is program give 12 instead of 11
This program output is 12 why? Someone help out public class Cal { int a= 5; int b=6; public static void main(String[] args) { Cal aa= new Cal(); Cal bb= new Cal(); int z= aa.b + bb.b; System.out.println(z); } }
2 Réponses
+ 1
You get the b properties of both aa and bb, therefore the answer is 6 + 6 = 12
0
Ooh thanks.