Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Knowing C++, how long does it take to learn Java? [closed]

Tags:

I am a competent C++ developer. I understand and use polymorphism, templates, the STL, and I have a solid grasp of how streams work. For all practical purposes, I've done no Java development. I'm sure some of you were in a similar situation at one point when you had to learn Java. How long did it take you to become a competent Java programmer?

like image 967
Dan Hook Avatar asked Apr 05 '09 15:04

Dan Hook


People also ask

How long will it take to learn Java after C?

I would say 2 weeks. For a person with no prior programming experience, it is expected approximately 9 months, that is 5+3+1 months to completely understand and write Java programs.

Is it easy to learn Java if you know C?

In fact, if you already know C or C++, learning Java will be incredibly easy. But don't let that discourage you if you're brand new to programming. Because Java's syntax is similar to human language, that makes Java coding pretty intuitive—even for beginners with no coding experience.

Is Java hard to learn after C?

It's common for programmers to learn more than one language. Java's syntax is borrowed from C++, so if you learn C++ first, it's easy to pick up Java.

Is Java close to C?

C# and Java are similar languages that are typed statically, strongly, and manifestly. Both are object-oriented, and designed with semi-interpretation or runtime just-in-time compilation, and both are curly brace languages, like C and C++.


2 Answers

I think that learning the language is not difficult. In fact, I used to be a full time C++ developer, and at some point I started writing Java code. But the thing is that I don't remember ever learning Java, so I guess I just figured it as I went. I've been doing full time Java for a long time now.

If you are well familiar with C++, you may want to read a list of the major differences (e.g., everything is dynamically-bound) and then start practicing on an environment (just download Eclipse). The small differences are the main thing you would have to get adjusted to.

Now that Java supports generics, one of the major switching pains is gone. Multiple inheritance, while not supported, is not a big deal if you get used to interfaces, and in fact having interfaces rather than abstract classes with pure virtual functions (PVFs) improves readability.

To me Java is a nice and friendly and relaxing sandboxed version of C++. I don't have to worry about general protection faults (GPFs), I don't have to worry about memory leaks, I don't have to worry about messing with pointers. However, don't let that confuse you, there are still plenty of opportunities to screw up royally, and they're sometimes even nastier to detect.

Just take the leap. If you have the instinct, it shouldn't be a problem.

like image 196
Uri Avatar answered Sep 17 '22 14:09

Uri


I went the opposite way. Started with Java, then moved to C and C++. For my own personal experience, it was much easier to learn Java than C/C++ (C++ especially).

Java in many ways is meant to be C++ with many of the undefined and unnecessarily complicated portions removed or simplified. IMHO, it had great success with that goal. As a result it's a very easy language to learn and use. Especially for someone who is familiar with C++.

The actual time it will take is very dependent upon the person learning the language. However, I think it's safe to say it will take less time to become competent in Java than it did in C++.

like image 20
JaredPar Avatar answered Sep 17 '22 14:09

JaredPar