S
Sanny
I want to know is it possible to do Array Calculation in one step?
FIRST
_________
Say I have array[100]; I want to assign each of them a Value of 0; In
just 1 step.
Currently I use for loop to assign each array element. But I think
there should be some way to initialize all elements to 0.
Does java initializes all elements to 0. When we have not assigned or
give it a null Value?
SECOND
--------------
Further I use an Array like
xx[j]=99; Here I have to first verify that i & j are between 0-10;
So I use
if ((i>0)&&(i<10)&&(j>0)&&(j<10)) xx[j]=99;
But What I want is since Java itself checks out of Bounds, Instead of
Hanging when i<0 or i>10 It just skip it. So my Code will work just
like xx[j]=99; and when out of Bounds Ocur it just skip that
instead of hanging. Can it be done?
That is Java do not hang when out of bound happens but just skip it
and go to next iteration
Something like.
if (xx[j]=99
=== (Out of Bound) break; else proceed further. Can
this be done in java?
THIRD
--------
Is it possible to use Arrays as Sets. And do Union, Intersect, and
other things we do in Set Theory.
Say we have two arrays of Booleans.
BB1[] U BB2[] Gives Union of BB1 and BB2
BB1[] XOR BB2[] Give XOR for the Booleans?
Is it Possible?
Bye
Sanny
FIRST
_________
Say I have array[100]; I want to assign each of them a Value of 0; In
just 1 step.
Currently I use for loop to assign each array element. But I think
there should be some way to initialize all elements to 0.
Does java initializes all elements to 0. When we have not assigned or
give it a null Value?
SECOND
--------------
Further I use an Array like
xx[j]=99; Here I have to first verify that i & j are between 0-10;
So I use
if ((i>0)&&(i<10)&&(j>0)&&(j<10)) xx[j]=99;
But What I want is since Java itself checks out of Bounds, Instead of
Hanging when i<0 or i>10 It just skip it. So my Code will work just
like xx[j]=99; and when out of Bounds Ocur it just skip that
instead of hanging. Can it be done?
That is Java do not hang when out of bound happens but just skip it
and go to next iteration
Something like.
if (xx[j]=99
this be done in java?
THIRD
--------
Is it possible to use Arrays as Sets. And do Union, Intersect, and
other things we do in Set Theory.
Say we have two arrays of Booleans.
BB1[] U BB2[] Gives Union of BB1 and BB2
BB1[] XOR BB2[] Give XOR for the Booleans?
Is it Possible?
Bye
Sanny