O'Reilly logo

Programming with Java by Sunil Patekar, Mahesh Bhave

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 25

MOVING FROM C++ TO JAVA

Many programmers learn C++ before learning Java. Unwittingly, one starts comparing the two languages. Since both the languages are object oriented and Java has kept the basic syntax of C++, learning Java can be much faster (if not simpler) for C++ programmers.

This section is divided in three parts. In the first part, we will compare keywords in the two languages and the effect thereof. In the second part, we will examine all the differences in the two languages in detail. In the third part, we will show how small- and medium-sized C++ programs can be converted into Java programs.

25.1 Part I: Comparing Keywords

25.1.1 Keywords

Let us start on a positive note. If you know C++, you know the heart of Java. The ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required