Ap Comp Science HW Question Methods
I can't figure this answer out. We just learned methods today and I am a little confused. The question is, Write a method called sum100 that adds up all the integers from 1 to 100 inclusive and returns the answer. If somebody wouldn't mind explaining how to do this that would be great! Thanks
Re: Ap Comp Science HW Question Methods
Post your attempt and ask a specific question. Try writing the method signature. For example the main method is:
So for your method you need to think about:
public static void main(String args)
what access it should have?
what return type it should have?
what name it should have?
what parameters it should have?
should it be static or non-static?
If you do not know then review your class notes, textbook or Google it.