Am new at Java and this is what am attempting to do;
I Have two files located on this folder on a windows machine;
d:\programs\sims\javasim\src\com\jsim\
Person.java
Building.java
On my Building.java am making use of class Person located in file Person.java i.e.
package com.jsim;
ArrayList<Person> personList = new ArrayList<Person>();
Am compiling the files from this folder
d:\programs\sims\javasim\src
But when i try to compile Building.Java, the compiler tells me
d:\programs\sims\src\javac com/jsim/Building.java
com\jsim\Building.java:10: cannot find symbol
symbol : class Person
location: class com.jsim.Building
private ArrayList<Person>personList = new ArrayList<Person>();
^
How can i make Building.java know about class Person in file Person.java?
Gath
execute javac *.java
or javac Person.java Building.java
or javac Building.java Person.java
to compile your classes.
Seems like Person.java is not compiled before compiling Building.java file.
Building needs Person's class file for compiling instead of .java file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With