Best way to learn Java for someone with a solid C ++ background? (books, etc.)

I installed Eclipse and the JDK, went through the Hello World tutorial and read the Eclipse docs (both about Eclipse itself and about Java development with Eclipse). I am looking at JUnit samples to better understand how Java works at startup.

I am in the confusion that comes when learning a new computer language with newer paradigms, and I think this is partly because of my experience with C ++.

Any suggestions for good Java tutorials / tutorials / etc. for someone with a C / C ++ background?

+4
source share
12 answers
  • Start by abandoning eclipse for a while and working only with a text editor and command line JDK tools to get a basic understanding of how Java programs, packages, class paths, and compiler errors work .
  • Check out the API docs . Start with key classes in java.lang, java.util, java.io and java.text
  • Sun Java Tutorials are a good starting point to deepen your understanding of specific topics.
  • The Java Language Specification and the Java Virtual Machine Specification can be a great help in understanding what is going on under the hood, which is probably comforting for the C ++ guy :-). They are quite readable as specifications go.
+6
source

Java is pretty big. I don’t know what problems you solved with C ++, but I would suggest you split Java into these lines:

Java SE is the main language. It includes the Swing UI and JDBC classes, so it would be useful to write desktop applications if that is what you used for C ++.

Java EE is built on top of Java SE. It has many "corporate" features, including Java, EJB server pages, messaging, etc. To create distributed, transactional, multi-user applications.

If you want to write desktop applications, I would recommend focusing on Swing and JDBC. All you need is JDK 6 and possibly the relational database of your choice.

If you want to write web applications, I would suggest JSPs written using JSTL and JDBC using a servlet / JSP mechanism such as Tomcat.

You can go a long way with these technologies. As you become more comfortable, expand the circle.

+3
source

Head First Java seems to be popular among the people I work with people from C ++. If you like math, solving problems on Project Euler can also be very fun doing it with Python now.

+1
source

I have always found the Sun Java Tutorial to be extremely useful. You can search for the basics of the language as needed (or quickly go through easy sections), but you can easily dive into more complex topics (GUIs with Swing, concurrency, containers, etc.).

+1
source

The best way to find out is to just do it. Especially if you can pair programs with a strong Java developer. This is what I did, and now I am much better in Java and it is difficult for me to return in C ++

+1
source

Yes, the libraries are huge, but instead of diving into the swing api, for honest communication with the language you might be better off writing small pieces that use collections (java.util package). I believe that this material is very important for everyday coding, and it will introduce you to both generics and how objects are created, both of which are very different from C ++.

I always found Thinking in Java - great text, very detailed and well written.

+1
source

For Javaisms you must read Effective Java 2nd Edition by Joshua Bloch

For unit testing (and more), good Pragmatic Programmers books.

Also a good book for learning Java, if you understand C / C ++, see Thinking in Java by Bruce Eckel . This book is good from some points, but falls to others (he and I do not agree with exception handling for one), but if you know C ++, then in general a good book to start with - just make sure you compensate for it with a couple Java books that are not intended for C ++ programmers :-)

For learning Java, well, the main language is pretty similar to C ++. Back in 1995, it took me about one day to catch up with Java, 3-5 days to figure out how it was different than C ++, and about a month to learn the libraries.

Java has changed a lot since 1995, though ... so one day it is still possible for sure for the first part. In terms of language, depending on what you want to pick up, say a week. The library ... well, that can take years (at least months) depending on what you focus on.

+1
source

Core Java contains C ++ notes across all books to explain the subtle differences between C ++ and Java.

+1
source

Once you're used to Java, I suggest that you read the JLS carefully. It's boring, like a ditch, but it can help indicate where Java does things differently, although it does have the same syntax.

0
source

If you want a solid Java foundation, I would recommend getting Java Programmer certification from Java. This will force you to learn every fundamental aspect of the language. I did this a few years ago, and I think it was useful. Your current employer may have programs to cover the cost of the test, which was a couple of hundred dollars, if I remember correctly.

0
source

I particularly agree with these suggestions:

Get certified Java programmer. This is a great introduction to the language, not expensive, and really gives you a good idea of ​​the core Java language. This can definitely help in a resume, for example. which together with the Java Developer certificate helped me get my first job in Java. Check out the JavaRanch program for online help.

Read Bruce Eckel Thinking in Java. It is free online! Great book.

Sun Java Tutorials. very useful.

For help, use the interactive Sun Java Docs and Java Almanac (on the Internet). Java Almanac is all code samples.

0
source

Books are interesting but learn. Create an application.

0
source

All Articles