-
Varargs: passing a variable number of arguments to a method
Read more: Varargs: passing a variable number of arguments to a methodFrom version 5 of Java you can call a method passing a variable number of arguments. A variable of this type is called varargs, you can only use in a method signature and its syntax is the primitive type or object type followed by 3 dots (ellipsis).
-
Large sum
Read more: Large sumFrom the Project Euler Problem 13: Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
-
Validation of an Edit Box control in the XPages
Read more: Validation of an Edit Box control in the XPagesIn the XPages the “Edit Box” controls have some settings that allow you to perform simple validations. These settings are under the label “Validation” of the control and depend on the value of “Display Type” under the label “Data”; in the figure you can see a screenshot of the validation of an Edit Box control…
-
Highly divisible triangular number
Read more: Highly divisible triangular numberFrom the Project Euler Problem 12: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45,…
-
Largest product in a grid
Read more: Largest product in a gridFrom the Project Euler Problem 11: In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98…
-
Summation of primes
Read more: Summation of primesFrom the Project Euler Problem 10: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. checked A processor Intel® Core™ i7-2720QM CPU @ 2.20GHz × 8 takes about 6 minutes to complete this calculation.
-
Project Euler – Problem 9
Read more: Project Euler – Problem 9From the Project Euler Problem 9: A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find…