# Syntax help with 2D array

**URL:** <https://discourse.processing.org/t/syntax-help-with-2d-array/45242>\
**Category:** Beginners\
**Created:** [October 29, 2024, 8:51am UTC](https://discourse.processing.org/t/syntax-help-with-2d-array/45242 "2024-10-29T08:51:34Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 31, 2024, 2:08pm UTC](https://discourse.processing.org/t/syntax-help-with-2d-array/45242/21 "2024-10-31T14:08:40Z")

</div>

> **[byte / Reference](https://processing.org/reference/byte.html)**
>
> Datatype for bytes, 8 bits of information storing numerical values from 127 to -128. Bytes are a convenient datatype for sending information to and from the serial port and for representing letters in…

> **[Primitive Data Types (The Java™ Tutorials \>        
            Learning...](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html)**
>
> This beginner Java tutorial describes fundamentals of programming in the Java programming language

- **byte** : The `byte` data type is an 8-bit signed two’s complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The `byte` data type can be useful for saving memory in large [arrays](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html), where the memory savings actually matters. They can also be used in place of `int` where their limits help to clarify your code; the fact that a variable’s range is limited can serve as a form of documentation.

---

<div class="post-metadata">

**Author:** ![Grumpy\_Mike](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/grumpy_mike/32/14787_2.png) [@Grumpy\_Mike](https://discourse.processing.org/u/Grumpy_Mike)\
**Post date:** [November 1, 2024, 7:32am UTC](https://discourse.processing.org/t/syntax-help-with-2d-array/45242/22 "2024-11-01T07:32:05Z")

</div>

> [@GoToLoop](#):
>
> They can also be used in place of `int` where their limits help to clarify your code; the fact that a variable’s range is limited can serve as a form of documentation.

Yes that is exactly why I am using the byte variable type. The final code is going to be used in a MIDI system where the maximum value I need to use is 127. So to check a valid value is being used all I need to do is check it is a positive number.

[Previous page](https://discourse.processing.org/t/syntax-help-with-2d-array/45242.md?page=1)
