Find the mistake in this coad | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Find the mistake in this coad

public class Program { public static void main(String[] args) { String name = "Howard"; int age = 42; System.out.println(name+"is" +age+"years old."); } }

4th Jan 2023, 5:19 PM
Paradox
Paradox - avatar
15 Answers
+ 3
age is commented. Remove the comment from age and System.out.println
4th Jan 2023, 5:36 PM
Lisa
Lisa - avatar
+ 3
Please put Java in post tags, 'findthemistake' doesn't bear any relevance to the code https://code.sololearn.com/W3uiji9X28C1/?ref=app
4th Jan 2023, 5:46 PM
Ipang
+ 2
What is the task? Check the white spaces in the output string.
4th Jan 2023, 5:23 PM
Lisa
Lisa - avatar
+ 2
Again: What is the 👉task? What error message do you get? Link the complete code.
4th Jan 2023, 5:42 PM
Lisa
Lisa - avatar
+ 1
What is the 👉TASK? What did you try?
4th Jan 2023, 5:31 PM
Lisa
Lisa - avatar
+ 1
Yes I was going to say the same thing as Lisa, that you commented out age
4th Jan 2023, 5:37 PM
Hassanah
Hassanah - avatar
+ 1
>> System.out.println(name+" is " + age+" years old.");
5th Jan 2023, 10:50 AM
Andre Richmond
Andre Richmond - avatar
0
Not working
4th Jan 2023, 5:27 PM
Paradox
Paradox - avatar
0
Can you explain me how to do
4th Jan 2023, 5:28 PM
Paradox
Paradox - avatar
0
public class Program { public static void main(String[] args) { //declare variables String name = "Howard"; /* declare the age int age = 42; */ //output values //System.out.println(name+" is "+age+" years old."); } } Fix this coad In java comment
4th Jan 2023, 5:33 PM
Paradox
Paradox - avatar
0
But the solution is showing this coad public class Program { public static void main(String[] args) { String name = "Howard"; int age = 42; System.out.println(name+"is" +age+"years old."); } }
4th Jan 2023, 5:40 PM
Paradox
Paradox - avatar
0
And not working
4th Jan 2023, 5:40 PM
Paradox
Paradox - avatar
0
Thank you so much finally it worked
4th Jan 2023, 5:44 PM
Paradox
Paradox - avatar
0
Convert the Integer age to String using str function.
5th Jan 2023, 4:44 AM
Sanjay Kamath
Sanjay Kamath - avatar
0
There is a syntax error in the code. The correct method signature for the main method in a Java program is: public static void main(String[] args) In the given code, the main method is declared as public static void main(String[] args), which is missing the void keyword before the main method name.
5th Jan 2023, 9:37 PM
Aditya Dixit