java

what are the complete difference between a c++ class and a java class?
[70 byte] By [ravi yerabolu] at [2007-11-15 20:13:36]
«« java
»» email system
# 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
kannanbalu at 2007-11-10 2:53:32 >
# 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
dogbear at 2007-11-10 2:54:32 >
# 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.
skakkar11 at 2007-11-10 2:55:31 >
# 4 Re: java
guys member fungtions and attributes not variable
at 2007-11-10 2:56:33 >
# 5 Re: java
guys member fungtions and attributes not variable
at 2007-11-10 2:57:32 >
# 6 Re: java
Skakkar11,

I stand corrected. (hence the rating...)

dogBear
dogbear at 2007-11-10 2:58:42 >