java
what are the complete difference between a c++ class and a java class?
# 1 Re: java
Hi,
Diff between c++ and java class:
1. All java classes are directly/indirectly
inherited from Object class
2. All methods are virtual by default in Java
but not in C++.
3. No multiple inheritance in Java.
Kannan
# 2 Re: java
Ravi,
Exactly what Kannabalu said...
...as well as:
4)Classes in Java are defined within the class declaration.
5)Member methods and variables in Java are, by default, public, whereas in C++ they are private.
6)In C++, Classes must be instanciated as pointers to make use of the new keyword. No pointers in Java(hurray!)
Regards,
dogBear
# 3 Re: java
hey dogBear said that:
Member methods and variables in Java are, by default, public, whereas in C++ they are private.
But the classes member data and functions have "friendly access" not "public" dogBear brush up your skllls.