Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
jb6.13 varargs
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { System.out.println("Hello, World!"); System.out.println(sum(1,2,3,4,5)); } public static int sum(int ... args){ int result = 0; for(int arg : args){ result += arg; } return result; } /* public static int sum(int a, int ... args){ System.out.println(a); } */ }
run
|
edit
|
history
|
help
0
a+b
Coding Challenge - 01 (Even numbers)
javajava
AllStar
names
Palindrome String Checking
boundary vs core
2D List Iterator
Zombie virus
[Java] Coding - Reverse CODE-String Method