hello,

When we initialised a java array then it store the default value of array
element.
Because 0 is the default value of int, so it print 0 9 times.

Thanks

On Wed, Nov 17, 2010 at 12:50 PM, Praveen D'Souza
<dsouzagprav...@gmail.com>wrote:

> public class JavaArray {
>
>    /**
>     * @param args the command line arguments
>     */
>    public static void main(String[] args) {
>
>        // Declare and create int array whose size is 10
>        int[] ages = new int[10];
>
>        // Display the value of each entry in the array
>        for( int i=0; i<ages.length; i++ ){
>            System.out.print( ages[i] );
>        }
>    }
>
> }
>
> y does it print 0 9 times..i am confused.. i taught i would print 0 1
> 2 3 4 5 6 7 8 9..please someone explain..thanks
>
> --
> To post to this group, send email to
> javaprogrammingwithpassion@googlegroups.com
> To unsubscribe from this group, send email to
> javaprogrammingwithpassion+unsubscr...@googlegroups.com<javaprogrammingwithpassion%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/javaprogrammingwithpassion?hl=en




-- 
Abhayanand
Sr.Software Engg.
Whishworks Pvt. Ltd.
+91-9494244723

-- 
To post to this group, send email to javaprogrammingwithpassion@googlegroups.com
To unsubscribe from this group, send email to 
javaprogrammingwithpassion+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to