Hello everyone, So I have problem in this code, there is no output and I can't find the reason | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Hello everyone, So I have problem in this code, there is no output and I can't find the reason

https://code.sololearn.com/cPTHAzwv78D4/?ref=app

19th Sep 2022, 7:57 PM
Mohamed Hassan Hassan
Mohamed Hassan Hassan - avatar
4 Answers
+ 3
No Main method or main method declarartion is wrong. Missing static public static void main ( String a[] ) { .. } edit: Mohamed Hassan Hassan and why you need 4 objects..? see this modified code : public class Program { public static void main(String[] args) { Scanner s = new Scanner(System.in); customerdata n = new customerdata(); n.fname = s.next(); n.sname = s.next(); n.age = s.nextInt(); n.room = s.nextInt(); n.data(); } }
19th Sep 2022, 8:02 PM
Jayakrishna 🇮🇳
+ 2
Thank you very much ❤️
19th Sep 2022, 8:13 PM
Mohamed Hassan Hassan
Mohamed Hassan Hassan - avatar
+ 2
New learner just trying but I really appreciate your help ❤️
19th Sep 2022, 8:14 PM
Mohamed Hassan Hassan
Mohamed Hassan Hassan - avatar
+ 1
U have to input all the 4 fields to see the result thats y
21st Sep 2022, 7:48 AM
Michael Mamo
Michael Mamo - avatar