1. I like that it's possible to define variables outside constructor, just at variable declaration. I think this is planned in C++ later on, but this feature feels quite obvious. Not sure why C++ doesn't have it.
2. No separate header/code file. I find it redundant to have header and code files like in C++. Most people say it's to prevent multiple definition, but if I define class' methods only inside class' file, there will be no multiple definitions.
2) As a C++ developer, why do you believe Java is better for your needs than Java? (Java better than Java? I think mistake here; assuming C++ better than Java)
1. Overloaded operators. Simplifies a lot things. Java has a few but you cannot add own ones. That's kinda stupid. You have to block them completely, or allow them completely.
2. Templates. They seem to be more advanced in C++ than in Java.
3) If you've used both, which do you prefer and why?
Definitely C++. I feel it's faster and gives me more freedom. Many people claim Java is faster, But even simple for() loop with little maths inside is slower in Java. C++ compiler tends to destroy loop as everything is constant (volatile fixes that), but even with volatile's disadvantages it remains faster.
4) What are the actual technical differences between the languages?
I believe Java adds simplicity for rapid development, especially with all the packages, great for basic/simple stuff. Plus Java is cross-platform, so you don't have to worry about anything but your program. On other hand, C++ takes time to create things, but it ends up very fast in execution, however it's not likely to run more than on one machine without recompiling and code edits.
5) Can you point me in the direction of some good resources to look at?
Google of course. You're likely to find to syntax or other differences, which have own advantages and disadvantages.
Edited by Ripiz, 29 April 2012 - 03:39 AM.
1) As a Java developer, why do you believe Java is better for your needs than C++?