0
Method main can't host System.out.printf(..) in this example.
5 odpowiedzi
+ 4
+ 3
hi, learn about getters and setters in tutorials the print statement you have in the main method cant access those instances that way. you need object.variable
Anime FanGirl this isnt advertising they are wanting help with there code?
+ 3
wally22 yes each time you make an object and pass arguments to the constructor the printf statment prints those parameters to screen each time
have a look at this Assignment i made it will help you with your oop coding. i have commented on my code if its any help
https://www.sololearn.com/discuss/1305461/?ref=app
+ 1
Thanks
https://code.sololearn.com/cz599hbhaJG0
I don't understand why when i put
System.out.printf("The construtor for %s %s, members in the club: %d\n", first ,last, members); in main my code don't compile!
But if i put System.out.printf("The construtor for %s %s, members in the club: %d\n", first ,last, members); in class Tuna my code work!
Thanks for your help.
+ 1
The method main can access to Sytem.ou.println() because this method is static by the way.
thanks