I am pretty green for java (I program in C / C ++) and I still haven't figured out how it all works.
I am not trying to ask someone to do their homework, I am just confused by some basic java materials. I have a task that wants me to create a maze. The destination comes with some files that were previously implemented and theoretically work. The folder gives me some .java files and some .class files. I opened the .java files, and most of them are interfaces without real code, so I assume this is meat in these .class files. My question is: how do I interact with these .class files? I need to do something like import myClass; if i have myClass.class file?
I tried to import the file directory in which these files are contained (via Eclipse), but it seems that the .class files are not showing. I assume it is being processed in the background?
Here is a link to the task http://www.ics.uci.edu/~goodrich/teach/ics23/LabManual/Dark/
Here's a zip file with all the .java and .class files http://www.ics.uci.edu/~goodrich/teach/ics23/LabManual/Dark/Dark.zip
Thanks in advance!
To add .class files to your project in Eclipse: right-click your project, select properties β Java Build Path β Libraries, and click Add Folder Class. Select the class folder.
, . , , .
:
myClass mc = new myClass();
(new myClass()).myRoutine();
-
myClass.staticalicious();
, .
, .class .java.
.class
.java
, , , Java:) MyClass, myClass.
.class - .java. , .class , :
: some.package.class
: import some.package;
import some.package;
, , , .
, - Java, " ", . .
, :
. Linux/Unix:
javac -classpath <dirWithClassFiles>:. .....
java -classpath <dirWithClassFiles>:. .....
.
- java-. java- .o C ++, "" , , .
.o
java , import some.package.name.*;, (, SomeClass some.package.name.SomeClass)
import some.package.name.*;
SomeClass
some.package.name.SomeClass
, IDE. IDE , ...
import example.some.Thing;
.java , .class. , .
Eclipse IDE .class. . perticular , .