Click to See Complete Forum and Search --> : Enumeration?
rjlohan
May 8th, 2002, 05:41 AM
What is the Java syntax for an enumeration?
Here's the VB equiv. of what I want:
Private Enum DoorMessage
CLOSE_FAST = 1
CLOSE_SLOW = 2
OPEN_FAST = 3
OPEN_SLOW = 4
End Enum
:confused:
Mark Sreeves
May 8th, 2002, 06:39 AM
This sort of thing:
class DoorMessage {
static int CLOSE_FAST = 1;
static int CLOSE_SLOW = 2;
static int OPEN_FAST = 3;
static int OPEN_SLOW = 4;
}
rjlohan
May 8th, 2002, 05:23 PM
Cool thanks.
Also - what's a useful Java compiler? I've got JBuilder3, but it doesn't like the project I'm working on (it's a Uni thing - I've got to make some changes to an existing system). Keeps giving me errors, when I know this code compiled somehow...
Mrs Kensington
May 9th, 2002, 02:52 AM
JBuilder isn't a compiler its a GUI.
You'll be best learning how to compile at the command line as it makes it alot easier to set up gui's if you know how the compiler works.
You should have it installed already. Just search your computer for javac.exe. If you don't have it you need to download the SDK from http://java.sun.com/j2se/1.4/download.html
Once you've found it change your PATH variable (look on the internet if you don't know how as it varies by OS) to point to javac.exe
To compile you go to the directory your code is in and type Javac myClass.java (where myClass is the name of the class) or you can do javac *.java
Then just run it by typing java myClass (***NOTE*** no extension)
Hope that helps
rjlohan
May 9th, 2002, 05:44 PM
Awesome. Cheers. :)
I've got the SDK and all that. I think my best approach will be to use JBuilder for development work, but not builds. It has a nice interface - colour coding and all that.
Yeah?
Mrs Kensington
May 10th, 2002, 02:11 AM
If it works for you, great!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.