63 206
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #8388 in Action Script | Flash | Flex | ColdFusion for Abdulrazaq Mubaraq

Question #8388
A simple java program to calculate numbers 1 to 200 and display the result
1. The program should operate in such a way that two classes and two custom methods are used withsame package.
2. One of the methods should have return type while the other should not.
Expert's answer
package calculatenumbers;

public class Main {
private static int
sum=0;
public static void main(String[] args)
{
System.out.println("Calculate numbers =
"+calculatenumbers());
}

private static int
calculatenumbers(){
for(int i=1;i<=200;i++){
sum+=i;
}

return
sum;
}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions