Memory management is automatically done by JVM with the help of Garbage Collector.
Java doesn't support multiple inheritence.
unlike c++, Java is a platform independent language
The main difference between Java and C++ in a network based progam is that there is no sockets support in the standard C++ library(or C for that matter). This is a good and a bad thing. Good because you actually have to learn sockets programming, Java abstracts it to the point where it is very easy to use, but you learn little. This implies that it is a bit more work. This also means that since you are directly using OS functions, it is not platform independant.
The main library for *nix OSes is the Berkley Sockets API. The main library in Windows in winsock, which is heavily based on Berkley, with just enough changes to break compatibility.
There are cross platform networking libraries available if platform independance is important to your project, many are free. Wxwidgets contains a networking library.
IO is a bit clunky in C++ compared to Java, but you don't need to get bogged down in pointers.
Both are great for networking, but if you are learning, stick to the langauge that doesn't hide as many details.
"Platform independant" as i understand it, means that you compile it once, and that same executable file can be run on any system (that has a JRE).
it does NOT mean that you write the code, and then compile it on 27 different machines to make 27 different binaries that each can only be run on a specific machine, even if they're all built from the same source code file.
Java is platform independant by this definition. So is standard C and C++.
Your defintion implies that only interpreted or hybrid(like Java) languages are platform independant. This is wrong, for two reasons. First is that standard C and C++ doesn't really care about the underlying OS, just like java, perl, ect. Second is that intrepreted languages suffer the same limitation as compiled languages, they don't(sometimes can't) have an interpreter for every platform.
Anyway minor point, and off-topic.
I am curious, what is a lowercase dad?
The subjective part is in calling things platform-independent and asking whether that's helpful or not. The term suggests there's an advantage over other tools or programs that do the same work; it is not a classification that suggests code can be written totally regardless of the hardware/OS.
C/C++ can be written in a platform-independent manner. With all due respect to the sizeof() operator, however, they are not inherently platform-independent. Highly portable, yes.
Some people argue that Java is not 'truly' platform-independent either. As I see it, those arguments are academic. JDK-supplied classes generally don't require recompilation to run. There are exceptions, but to me this just means platform-independence isn't bulletproof.
The practical benefits of avoiding recompilation are substantial. Would you rather download a JAR file and get straight to work, or would you prefer providing a compiler, running make/ANT files, waiting a few minutes, and hoping everything works out?
[ June 02, 2006: Message edited by: Michael Ernest ]
Originally posted by fred rosenberger:
lowercase comes from the fact that i seldom use the shift key when typing. While i was in the process of adopting my daughter, EFH changed my title to "dad to be". once the adoption was complete, he changed it again to "dad".
I see, that is a nice story. I hope all is going well.