r/learnjava • • 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

13 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Nov 21 '14

[deleted]

1

u/imgonnabethebest Nov 21 '14

yeah i got it now thanks. doing an exercise http://www.reddit.com/r/learnprogramming/comments/2mydur/trying_to_print_stars_without_using_for_loops/

i also learned that you can call on methods and use them inside another method that you're trying to write. thats some inception next level shit, pretty cool.

0

u/[deleted] Nov 21 '14

[deleted]

0

u/imgonnabethebest Nov 21 '14

ya bro :) didn't you read the comments