moving from c++ to java...?

0 lior bitton · March 21, 2015
hi bucky and everyone,
ive been looking for a good tutorial that teaches java to somewhat more experienced programmers,
im computer science student and have a good and solid c++ and OOP knowledge
but all guides and tutorials are for beginners and people with no programming experience,
does anyone know of a good tutorial?a book?
or maybe i just gave you another tutorial idea bucky...?
thanks a lot...

Post a Reply


Oldest  Newest  Rating
0 Dol Lod · March 21, 2015
In a nutshell, the main purpose of java is to provide reliable code,not performance optimized code. That being said, C++ is better for performance, but Java is much more reliable. 

There are no header files in C. All methods must belong to a class.

Importing: This is done through import. ex. import java.util.*. The * means to get all libraries in that package. 

All primitives are passed by value. Primitives are things like ints, doubles, booleans. All objects are passed by reference.

== compares primitives by value, but objects by reference. The .equals method for objects should be overwritten and compares objects by value. 

Typecasting can only be done going from a superclass to a subclass and uses a runtime check. The isInstanceOfMethod tells you if it is a member of a particular class.

All objects have a toString method that can be overwitten for custom classes to print out the class in string format.

Inheritance:Single parent for using the extends keyword. Implements is another keyword that implements an interface and this can be done for as many interfaces as you want to implement. You can call a superclass's method by using super.methodname.

The main function is declared to be static and belongs to one particular class.

Extended for loops do exist in Java so you don't have to do size comparisons externally. However, this only gives you a copy of objects located at that spot, so you can't modify the contents. 

Operators cannot be overwritten. Most built in classes that are not interfaces cannot be inherited from.

You should probably the videos on collection,StringBuilders and inheritance for more specific details. Additionally, you should watch the input and file manipulation tutorials. There are probably more features that I missed or didn't cover specifically, but these are the more general ones. 

It's simple to learn Java after knowing C++. Java's the first language I learned after C and C++. 
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator