Tutorial's Java example uses incorrect types
`FlatBufferBuilder.createString` returns an int offset, not a string
This commit is contained in:
parent
91c27148c0
commit
68c69b3717
|
@ -432,10 +432,10 @@ our `orc` Monster, lets create some `Weapon`s: a `Sword` and an `Axe`.
|
||||||
</div>
|
</div>
|
||||||
<div class="language-java">
|
<div class="language-java">
|
||||||
~~~{.java}
|
~~~{.java}
|
||||||
String weaponOneName = builder.createString("Sword")
|
int weaponOneName = builder.createString("Sword")
|
||||||
short weaponOneDamage = 3;
|
short weaponOneDamage = 3;
|
||||||
|
|
||||||
String weaponTwoName = builder.createString("Axe");
|
int weaponTwoName = builder.createString("Axe");
|
||||||
short weaponTwoDamage = 5;
|
short weaponTwoDamage = 5;
|
||||||
|
|
||||||
// Use the `createWeapon()` helper function to create the weapons, since we set every field.
|
// Use the `createWeapon()` helper function to create the weapons, since we set every field.
|
||||||
|
|
Loading…
Reference in New Issue