What is the Error in this code & how to resolve this ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

What is the Error in this code & how to resolve this ?

Why I am getting error of this code even I am using simple method. public class Program { public static void main(String[] args) { nameAge(Rahul,22); } public static void nameAge(String name ,int age) { System.out.println("The Age of "+name+"is = "+age); } }

26th May 2017, 4:16 PM
Rahul Roy
Rahul Roy - avatar
2 Answers
+ 9
public class Program{ public static void main(String[] args) { nameAge("Rahul", 22); } public static void nameAge(String name, int age) { System.out.println("The Age of " + name+ " is = " + age); } } /*You missed those double quotes bro.*/
26th May 2017, 6:31 PM
Biraj Patel
+ 5
please correct the code and show the output
26th May 2017, 4:26 PM
Rahul Roy
Rahul Roy - avatar