1
Off Topic / Need help w/ Java
« on: September 22, 2015, 02:24:06 PM »
Hey guys, I'm partially really stupid if you can't remember, and I need help with figuring out what exactly my documentation provided for a code lab is specifying for me to do. I figured some of you have some knowledge in coding and computer science and all that and I might as well ask here while I'm scratching my head trying to figure it out.
We're forming a primitive array that will store objects while keeping track of a class-level boolean that determines whether or not nulls are allowed in the array, and there are four constructors to implement.
I'm confused about what it means in the bold. The class implements RandomAccess and Iterable. Where am I getting a small power of two from? Am I just putting in whatever small power of two I feel like? The default constructor of DynArray() also says "the internal array is a small power of two determined by the implementation."
We're forming a primitive array that will store objects while keeping track of a class-level boolean that determines whether or not nulls are allowed in the array, and there are four constructors to implement.
Quote
Code: [Select]DynArray ( boolean allowNulls )
Creates a DynArray object that may allow or disallow its elements to be null values, depending on the value provided for the allowNulls parameter. The internal array created by this constructor is a small power of two that is provided by the implementor.
I'm confused about what it means in the bold. The class implements RandomAccess and Iterable. Where am I getting a small power of two from? Am I just putting in whatever small power of two I feel like? The default constructor of DynArray() also says "the internal array is a small power of two determined by the implementation."