CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: java

  1. #1
    Join Date
    May 2000
    Location
    chennai,india
    Posts
    9

    java

    what are the complete difference between a c++ class and a java class?


  2. #2
    Join Date
    Jan 2000
    Location
    CA, USA
    Posts
    305

    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





  3. #3
    Join Date
    Mar 2000
    Location
    Dublin, Ireland
    Posts
    124

    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


  4. #4
    Join Date
    May 2000
    Posts
    2

    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.







  5. #5
    Guest

    Re: java

    guys member fungtions and attributes not variable



  6. #6
    Join Date
    Mar 2000
    Location
    Dublin, Ireland
    Posts
    124

    Re: java

    Skakkar11,

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

    dogBear


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured