Click to See Complete Forum and Search --> : java


ravi yerabolu
May 12th, 2000, 10:46 PM
what are the complete difference between a c++ class and a java class?

kannanbalu
May 15th, 2000, 01:18 PM
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

dogbear
May 16th, 2000, 05:00 AM
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

skakkar11
May 16th, 2000, 06:28 AM
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.

May 16th, 2000, 08:54 AM
guys member fungtions and attributes not variable

May 16th, 2000, 08:54 AM
guys member fungtions and attributes not variable

dogbear
May 16th, 2000, 10:01 AM
Skakkar11,

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

dogBear