countrydude
Baseband Member
- Messages
- 62
- Location
- Alberta, Canada
Thanks, that actually does explain it.
but I have another question: why is the parameter '54' when you call the method inside main?
Your welcome.
I just picked a random integer as a parameter to demonstrate. If in the method parameters you declare that it can take in an int (like the red writing above in the last code example) then you can give any int you want. Doesn't have to be a 54. Or it can be a variable that has a integer stored in it. Same goes for other primitive types as well (ex. int, char, double...) and other things as well. Though if you declare in the method parameters to take in a int but you try to pass a String in your main method to it, you will get an error. Hope that makes sense.