Java vs C - Differences between Java and C Kind of*bleh differences 1 C code is compiled whereas Java bye-code is interpreted via the Java Virtual

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Differences between Java and C++: Kind of *bleh* differences: 1) C++ code is compiled, whereas Java bye-code is interpreted via the Java Virtual Machine -implications: C++ code is not transferable between machines and because of a lack of standardization, many “rules” are compiler-specific -Java: code is portable and, theoretically, even bytecode is portable -at one point, C++ code was radically faster than Java, now it is only slightly faster than Java (in the general case). 2) The Java compiler is typically more picky about rules, which means more errors in C++ have the potential to show up at runtime. 3) Variables get initialized in Java, they don’t in C++. (Who has to do it then?) 4) No bounds checking for arrays in C++ (Who has to do it then?) 5) Dead pointers exist in C++ without careful management BY THE PROGRAMMER. Java does garbage collection. 6) Typecasts can be done in C++ that can lead to disastrous and confusing situations (legal typecasts from one type to a totally unrelated type). Implication?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/07/2011 for the course COMP 2710 taught by Professor Staff during the Fall '08 term at Auburn University.

Ask a homework question - tutors are online