Get stuck in a Java primer

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

Get stuck in a Java primer
Get EXIF information in Java
Find a subset in Java
[Java] Get KClass in Java [Kotlin]
I created a PDF in Java.
Get Null-safe Map values in Java
A simple sample callback in Java
Easily get an integer from a system property in Java
Get a non-empty collection from an Optional stream in java
A solution to Docker errors that beginners tend to get stuck in
Get the public URL of a private Flickr file in Java
About returning a reference in a Java Getter
What is a class in Java language (3 /?)
When seeking multiple in a Java array
Get the result of POST in Java
[Creating] A memorandum about coding in Java
Java creates a table in a Word document
Java creates a pie chart in Excel
What is a class in Java language (1 /?)
Create a TODO app in Java 7 Create Header
Try making a calculator app in Java
How to get the date in java
Get history from Zabbix server in Java
Implement something like a stack in Java
Split a string with ". (Dot)" in Java
Creating a matrix class in Java Part 1
Partization in Java
Changes in Java 11
Rock-paper-scissors in Java
How to get the absolute path of a directory running in Java
Pi in Java
FizzBuzz in Java
GetInstance () from a @Singleton class in Groovy from Java
Two ways to start a thread in Java + @
Read a string in a PDF file with Java
Create a CSR with extended information in Java
Stuck in an enum in front of a blacksmith
A story about the JDK in the Java 11 era
[Android / Java] Operate a local database in Room
Measure the size of a folder in Java
Code to escape a JSON string in Java
Try to create a bulletin board in Java
How to get Class from Element in Java
A note when you want Tuple in Java
I wanted to make (a == 1 && a == 2 && a == 3) true in Java
I wrote a primality test program in Java
Let's create a super-simple web framework in Java
I made a rock-paper-scissors game in Java (CLI)
Rails logger Get a rough idea in 1 minute
A bat file that uses Java in windows
Java tips-Create a Spring Boot project in Gradle
Library "OSHI" to get system information in Java
A quick review of Java learned in class
[Java] Get a random value from an array
I wrote a prime factorization program in Java
Points stuck in building VSCode & Java development environment
[Java] Get KFunction from Method / Constructor in Java [Kotlin]
Get along with Java containers in Cloud Run
Get the URL of the HTTP redirect destination in Java
[java] sort in list
Read JSON in Java