954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

New to Java

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

Bob4life2000
Newbie Poster
7 posts since Oct 2003
Reputation Points: 11
Solved Threads: 0
 

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

Dante Shamest
Light Poster
46 posts since Apr 2003
Reputation Points: 13
Solved Threads: 0
 

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

Bob4life2000
Newbie Poster
7 posts since Oct 2003
Reputation Points: 11
Solved Threads: 0
 

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

Bob4life2000
Newbie Poster
7 posts since Oct 2003
Reputation Points: 11
Solved Threads: 0
 

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...

Bob4life2000
Newbie Poster
7 posts since Oct 2003
Reputation Points: 11
Solved Threads: 0
 

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

Iron_Cross
Junior Poster
117 posts since Jul 2003
Reputation Points: 46
Solved Threads: 2
 

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.

Bob4life2000
Newbie Poster
7 posts since Oct 2003
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You