Hello,

I have been working with Java for appox the last six months but I still am very un-sure of myself. I need help figuring out how to import one Java file to the current one running. I am using Jcreator LE as a source editor/compiler and I wish to rum my program in the Console mode. Any help will be appreciated.

Thank you

Bob

Recommended Answers

All 6 Replies

If the java class files are in the same directory, you do not need to import them.

how though, do i have the program call that class???

I figured it out in case you were wondering. Boy do I love Java, lol!!!

Ok,

New issue...
I currently have this for source code for the Enemies in my game. class Enemy
{String name=("George");
int Hp;
int Pp;
}

what I want to do is set up a seperate file forenemystorage and then everytime an enemy is created, (I have that working) I want it to go to that file, and randomly (although based on character level) pick an enemy to create, with differen stats names etc etc etc...

This might work. Have a different class for each "type" of enemy. Each "type" of enemy can pull random weapons, items, etc. But then make an array of classes, and whenever you want to make a new enemy, pull a random number (with some sort of method) and use that method number as the index number for the array. That way, you get a semingly unique enemy each time.
I hope this made sense :P

Huh??????

I don't know about the arrays. As i said I have only been working with Java for a relativly short time and I am not sure of how to pull from an array of classes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.