tags:

views:

402

answers:

6

Long story short:

I'm looking for either a book or documentation/reference explaining basic java syntax and functionality from a C++ perspective. I don't need to know about design patterns, encapsulation, keywords such as 'static', etc.

What I do want is to know what packages are, know about the import/extends keywords, mostly syntax related stuff (ex: inheriting), basic structuring of a java program, etc.

If it matters at all: I'm planning getting into Android development - but have no Java background.

+4  A: 

I know how you feel - going from C++ to Java is a rather discouraging process - most of the books and articles treat you as a beginner when all you want is the differences.

I came across this site which was exactly what I needed.

Bonus points: Cheat-sheet!

LiraNuna
That cheat sheet is awesome :)
Daniel
+2  A: 

Java for C/C++ Programmers by Michael C. Daconta

http://pages.cs.wisc.edu/~hasti/cs368/JavaTutorial/

joe
+1  A: 

IMO the biggest difference is the vast range of standard functionality that is present in Java compared to C++.

The biggest challenege I faced was to get out of the habit of automatically rolling my own libraries for any non-trivial functionality, without first recoursing to the JDK.

Visage
A: 

android uses it's own jvm. it has the standard jdk minus swing and awt (gui stuff).

you should think of a reference as a pointer (but you can't do pointer arithmetic with it).

packages are a directory structure enforcement policy.

extends means inherits from (java uses implements if the base "class" is an interface).

import is like an include (but the code is compiled).

everything in a java program must be in a class.

Ray Tayek
A: 

imho you need two books:

dfa
A: 

And the biggest problem/change is: You can't use raii, so while you newer need to free your memory, you need to remember to close your files, and other resources your self.

And you can't use finalize as a destructor.

Martin Tilsted