Search Contact information
University of Cambridge Home Department of Engineering
University of Cambridge >  Engineering Department >  computing help

Java Course and CUED's C++ courses

This page covers issues related to CUED's C++ courses (for those confident enough about C++ to use it as a basis for learning Java). Other pages of CUED java support include Many of the basic programming concepts coverered in CUED's 1A and 1B C++ courses will be of use when learning Java ( up to about chapter 5 of David J. Eck's Introduction to Programming Using Java). Computer arithmetic, the use of for, while, if, etc and the idea of classes with public/private parts are similar in both languages. In some ways Java is a stricter (safer) language than C++. Also Java forces you to think in terms for classes and object-orientation, so you'll need to have understood the 1B C++ computing course before being able to transfer your knowledge to Java. In Java everything except the primitive types are objects all sharing a common ancestor java.lang.Object, which has a few methods (toString for example) which all objects inherit.

The more C++ you know, the more similarities and differences you'll find between the languages. Java was designed to be a "simple, object-orientated, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, and dynamic language". Some of these design criteria limit Java's functionality or make apparently simple tasks complex (if you want a program to work the same way on many types of machines you either need to go for the lowest-common-denominator, or write complicated code). Here are some examples of similarities and surprising differences that C++ programmers might notice when learning Java

© Cambridge University Engineering Dept
Information provided by Tim Love (tpl)
(with help from various COs).
Last updated: June 2002