Clogged with introductory book Then, after one night, I rewrote it from the beginning according to the book "Practical Java Gamenics Easy Master Kindle Edition". I was able to compile.
Install split-diff on Atom and compare with the file created the day before. There were no typographical errors. Just in case, I matched the half-width spaces and it was compiled. The folder structure is New) D: \ Study \ edu \ rpg \ weapon Old) D: \ Study \ temp \ edu \ rpg \ weapon
The compile command is New) D: \ Study> javac -encoding UTF-8 edu \ rpg \ weapon \ Weapon.java New) D: \ Study> javac -encoding UTF-8 edu \ rpg \ weapon \ ShowWeapon.java New) D: \ Study> java edu.rpg.weapon.ShowWeapon New) Output) Claymore
Old) D: \ Study \ temp> javac -encoding UTF-8 edu \ rpg \ weapon \ Weapon.java Old) D: \ Study \ temp> javac -encoding UTF-8 edu \ rpg \ weapon \ ShowWeapon.java Old) D: \ Study \ temp> java edu.rpg.weapon.ShowWeapon Old) Output) Claymore
As far as I can understand, there is no problem in arranging the Class file and declaring the package.
The half-width space is the space inside the super parenthesis of "super (WeaponType.SWORD," Claymore ");" in Claymore.java, and it could be compiled even if the space was added as a trial.
I learned to sleep overnight if I got stuck.
Also, as a division, New York may not be good anymore.
Recommended Posts