Results 1 to 2 of 2
- 10-04-2013, 04:52 AM #1Member
- Join Date
- Oct 2013
- Rep Power
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
- 10-04-2013, 05:50 AM #2
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:
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.
- By noobie_nate in forum New To JavaReplies: 2Last Post: 08-11-2013, 10:22 PM
- By NadE88 in forum NetworkingReplies: 2Last Post: 04-04-2013, 02:14 AM
- By svo in forum New To JavaReplies: 9Last Post: 04-08-2012, 06:29 PM
- By padutch in forum New To JavaReplies: 4Last Post: 11-28-2007, 12:59 AM