as long as I know array is fixed, somebody tell me this code at
constant variable :

class ArraySample
{
        public static void main(String[] args)
        {
          int []ArrVar1 = {1,2,3,4,5,6,7,8,9,10};

          //change of fix value array or
          //it's means change dimension size of array
          final int A = 10000;
          int []x = new int [A];
          x = new int [10];

                for (int a=0; a < ArrVar1.length; a++)
                {
                   System.out.print(ArrVar1[a]);
                }

                for (int c=1; c < x.length; c++)
                {
                   System.out.println(x[c]);
                }

        }
}

----------------------------------------------------------------------------------------------

the output :

123456789100
0
0
0
0
0
0
0
0

----------------------------------------------------------------------------------------------

QUESTION :

1. why after print number 10 at the end still print default array
value os zero ??
2. why 0 value is print only 8 times ?

I don't understand this, somebody tell me please?




--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to