public static void sum(int a, int b) {
int c = a + b;
System.out.println(c);
}
i solved in many ways but still i am getting error please give any tip
Resolved
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Girish Patel
26 August 2019, 20:03
You can call only sum() method directly in main() method by passing 2,2.
sum(2,2);
0
Alok Dayal
1 April 2019, 09:13
sum(2,2);
0
sameer mansuri
26 March 2019, 17:10
no need to declare variables twice they've been already declared;(i.e, r,d)
only assignment of number is left in sum()
0
Guadalupe Gagnon
26 March 2019, 13:35solution
Though you did successfully solve the task, you changed the sum method from the default at start. Reset the task and write your code in the main method without touching the sum method.
+2