r/learnjava • u/imgonnabethebest • Nov 21 '14
learning about methods, question
it's not covered in the text so i figured i'd ask. so basically methods = a way to make your text nice and clean and readable. so if u did something like checking if a number is like odd or even or something that involves if statements or else statements, you put it in a method then call on that so your "main method (am i using the correct terminology)" is readable and cool.
also, do all methods u make need to be after the main method? can it be before the main method like you have something called checkEvenOrOdd() before the main method, then in the main method u call on that. is that wrong ? thx bros
0
Upvotes
1
u/seronis Nov 21 '14
Is this meant to be in /r/learnprogramming instead of /r/learnjava ?
Java doesnt require forward declarations in the sense that C and C++ do. All methods in a class can see each other regardless of their position within the class.