Perry Smith

Java Questions & Answers

Archive

Home / Java Q & A Archive Page 5 / Java Q & A Archive / Java Main Page

Help a C programmer
Monday, 12-Jul-1999 15:45:31
207.140.148.33 writes:
I've been a C programmer for a long time and am moving to learning JAVA. I am familiar with most of the OO concepts. Some basic questions:

1. What is the equivalent of #if 0/#endif for Java.

2. What is the right way to create and modify global variables for Java.

3. What does an application with multiple classes look like in java. Does it compile into one executable? How do you deliver an executable?
Since this is interpreted, there is no linker, but is there a utility to coalesce all the class executables into one?

4. Is there an equivalent for "make" for this stuff? Does anyone know of a make port for win95?

IS:~::~::~::~::~::~:


Response
Re: Help a C programmer
Monday, 12-Jul-1999 20:45:41
171.210.132.14 writes:
1. ... uh, I'll let someone else handle that.. I'm not familiar with any #if 0/#endif statements in C.

2. Global variables are initialized in the constructor usually, or alternatively on the same line as the declaration. To have a counter which tracks the number of instances of a particular class, the initialization would have to be done with the declaration, as the constructor would be used to increment.

3. Multiple classes do not compile into an executable. Most are bundled into a *.jar file. Executables can be delivered with the JRE available from the Sun site, with an overhead of 10 add'l MB.

4. Creating platform-specific code usually means that Java isn't the right language. C++ is a lot faster. But if you must Java and have a native executable, there are some vendors which convert Java class files into native executables. TowerJ, Asymetrix Supercede (which seems to have gone missing in the last couple months), and others...:~::~::~::~::~::~:

MikeD


Home / Java Q & A Archive Page 5 / Java Q & A Archive / Java Main Page