D:\Study>java -version java version "1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
Easy Master Kindle Edition with Practical Java Gamenics I started studying along with, but I became suspicious when I started talking about dividing the source files into directories and packaging them. Or rather, it's packed.
This book is structured so that you can get lost in a world where the main character is dominated by swords and magic, and create an RPG-like program. It feels like I'm explaining Java in a light novel.
In "Chapter 3 Weapon Equipment", we will talk about inheritance, abstract classes, and packages. The details of the mold are being skipped with incredible momentum. It helps.
The story was confused after I met a character named Senior in "Chapter 3-3 Blacksmith Mae". Seniors started to divide into packages. (It's hard to see because I can't write markdown well) D:\Study
/edu/rpg /personal/Character.java /weapon/WeaponType.java Weapon.java MasterWeapon.java Claymore.java
For the time being, I created a folder according to the book, created a file, and typed it in variously, but WeaponType.java can be compiled, but Weapon.java etc. that refers to this can be compiled.
D:\Study>javac edu\rpg\weapon\Weapon.java edu \ rpg \ weapon \ Weapon.java: 4: Error: Symbol not found private WeaponType weaponType; ^ Symbol: Class WeaponType Location: Class Weapon edu \ rpg \ weapon \ Weapon.java:5: Error: Symbol not found public Weapon(WeaponType weaponType, String weaponName) { ^ Symbol: Class WeaponType Location: Class Weapon edu \ rpg \ weapon \ Weapon.java:14: Error: Symbol not found public WeaponType getWeaponType() { ^ Symbol: Class WeaponType Location: Class Weapon 3 errors
At the beginning of each source, as in the book, package edu.rpg.weapon; Is described, but I cannot proceed from here.
It may be a typographical error, or you may not know the basics. For the time being, I will enjoy swords and magic at FOG, and as a member of the Division, I will go to save the devastated New York. I'm looking forward to Division 2.
EOF
Recommended Posts