|
C++
|
Java
|
|
Write once,
compile anywhere.
|
Write once, compile once - portability
|
|
Manual memory
management.
|
Automatic Garbage Collection.
|
|
Multiple inheritances.
|
Single inheritance.
|
|
Methods need
to be explicitly declared virtual1.
|
Non-static2 Java methods are always virtual1.
|
|
Data type
sizes is implementation-dependent.
|
Defined sizes for primitive data type.
|
|
Linked list
needs to be implemented.
|
Linked list is implemented in standard library.
|
|
A string is character
arrays.
|
A string is an object of String class.
|
- A virtual method is a method which its implementation is determined at run time, dependent on the actual type or class that is invoking the object.
- A static method in Java is a method that can be called without needing to instantiate an object of class. An example: public static void main(String[] args)
No comments:
Post a Comment