Posted by: Chyne on: September 2, 2009
I knew history is quite a boring subject for certain people but few days ago, I just read an interesting history related to JavaScript else I won’t remember the story after several days. Anyway, I try to make it as interesting as possible because I always feel that telling a story is not a difficult [...]
Posted by: Chyne on: August 30, 2009
Recently, I just bought a book entitled ‘Ajax Bible’ written by Steven Holzner. Well, I guessed I shouldn’t just keep waiting for myself to finish other books (which I’m not sure when I’m going to finish it) and ignore the chance to learn other new technologies. Maybe it’s time to learn how to be a [...]
Posted by: Chyne on: May 23, 2009
/* Exercise 7.13
* 1. Use enhanced for statement
* 2. Sum the double values passed by the command-line arguments.
* 3. Use the static method parseDouble of class Double to convert a String to a double value.
*/
package Exercises;
public class SumDouble {
public static void main(String []args)
{
// get array size from first command-line-argument
int arrayLength = Integer.parseInt(args[0]);
int array[] = [...]
Posted by: Chyne on: May 23, 2009
/* Exercise 7.12
* 1. Size of the array specified by the first command-line argument.
* 2. If no command-line argument is supplied, use 10 as the default size of the array.
*/
package Exercises;
public class SizeOfArray {
public static void main(String[] args) {
// check existence of command-line arguments
if (args.length == 0)
// set default size of array to 10
int array[] [...]
Posted by: Chyne on: May 23, 2009
/* Exercise 7.11
* 1. Calculates the product of a series of integers
* 2. Passed to method product using a variable-length argument list.
* 3. Test the method with several calls, each with a different number of arguments.
*/
package Exercises;
public class CalculateProduct {
// calculate the product
public static int product(int… numbers) {
int product = 1;
// multiply the series of [...]