New course! Every coder should learn Generative AI!
Try a free lesson+ 1
What is wrong in this java code using scanner?
5 Answers
0
You are welcome bro. Keep learning. Keep coding.
+ 1
java() is constructed to look for name and age arguments to be passed to it but no arguments are.
however you also never us the name and age argument being passed as they are immediately overwritten by user input
+ 1
In your main method, you have called your method without setting parameters which generates an error. try setting the scanner to the main method and pass the values to the method
+ 1
Correct code:
https://code.sololearn.com/cXkEsrWQwb33/?ref=app
+ 1
Thnkuu nafis bro