Wow. In about an hour, I managed to learn the basics of Java.
And I must say, its damned convenient compared to C, even C++ in some (rare) cases, but it still can't outmatch the latter. C++ pwns it by a longshot. The lack of pointers is a major discrepancy, along with the bytecode thing. The whole virtual machine crap is essentially emulation, but there's always the GNU Java Library for native compilation, so thats not really a concern. If you haven't heard of it, I suggest you try it out
here
(Thank you Richard Stallerman.
)
Another thing I don't really like is the whole concept of outright
forcing you to use object oriented programming. While I can understand the whole reasoning behind it, and why they did it, it really irks me that they removed global functions. The really powerful thing about C++, and why I love it so much, is the extendability of it. You could essentially build your
own api with typedef, #define, operator, class, and struct. Sure, you got your things like the '+' operating with a string and a variable returns a text readout of it, but I could do that with the C++ 'string' class by inheritance and the 'operator' keyword.
#include <string>
#include <cstring>
//warning: very crude, wrote for demonstration.
class better_string : private string
{
better_string operator+ (const int& vartoprint)
{
better_string tempstring;
char temp [255]; //yes I know this is unsafe
sprintf(temp,"%s%d",this->c_str,vartoprint);
tempstring.assign(temp);
return tempstring;
}
}
Hell, if I wanted to, I could probably code all the little convinces that you get in java, right into a C++ header file. I'll give java credit: its a good, streamlined, basic language; especially for learning your first C syntax-ish language, but you'll probably want to move to C/++/0x (when it comes out) later.
EDIT: Forgot link to GCJ:
http://gcc.gnu.org/java/
If you jump high enough you'll hurt your ankles when you land.