LoginSignup
7
3

More than 5 years have passed since last update.

Java Byte配列の定義と初期値

Posted at

Javaでbyte配列を使用する場合の備忘録

配列の定義の仕方

Definition.java
byte[] aaa = new byte[size];

Byte配列の初期値

byteは「0」で初期化される。

初期化をする場合

init.java
//定義時に初期化する場合
byte[] aaa = new byte[size]{0};
//明示的に0埋めする場合
Arrays.fill(aaa,(byte)0);
7
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
3