my dog learned polymorphism*
The moose likes Beginning Java and the fly likes java [What are the differences between Java and C++?] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "java [What are the differences between Java and C++?]" Watch "java [What are the differences between Java and C++?]" New topic
Author

java [What are the differences between Java and C++?]

Jayashri Bolage
Greenhorn

Joined: Sep 21, 2009
Posts: 3
what are difference between the java and c++?
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3826

This one & this from wikipedia have some good comparisons. And please carefully choose one forum when posting here.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114
    
  16

See this recent topic.

Please use a meaningful subject line instead of "java" when you post a question.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
s.palanivel rajan
Ranch Hand

Joined: Sep 22, 2009
Posts: 40
these are the techniques which are not allowed in java but allowed in c++

Pointers
Structures & unions
Operator overloading
Multiple inheritance
Goto operator
Automatic type conversion
Destructors
Unsigned integers


With Regards,
S.Palanivel Rajan B.E.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

s.palanivel rajan wrote:these are the techniques which are not allowed in java but allowed in c++

Pointers

Thank the gods, pointers are how you program in assembly language. They are the source of untold bugs.

s.palanivel rajan wrote:Structures & unions


While technically correct, a java Class is the same as a 'struct' if you don't have any functions.

s.palanivel rajan wrote:Operator overloading


This was popular in languages designed in the 70s, Ada, C++, etc. And the example was always dealing with Strings or Complex numbers.
The problem is, that a decent language should have Strings (and probably Complex) build in, and when you have that, then the obvious uses of operator overloading are rare.

s.palanivel rajan wrote:Multiple inheritance


The bain of my existence when I was a C++ developer

s.palanivel rajan wrote:Goto operator


GOTO considered dangerous. Was true when Djkistra wrote it, and is still true today

s.palanivel rajan wrote:Automatic type conversion


Actually, Java has this for some cases. Strict language designs discourage it.

s.palanivel rajan wrote:Destructors

another huge source of bugs, handling destuctors properly with exceptions is a real challange.

s.palanivel rajan wrote:Unsigned integers

I don't see this as a problem, but not having unsigned byte data is a pain for crypto code
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
As I see it c++ puts more control over system resources in the hands of the programmer. As a result c++ offers a bit more flexibility when it comes to optimizing some performance critical applications.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Fred Hamilton wrote:As I see it c++ puts more control over system resources in the hands of the programmer. As a result c++ offers a bit more flexibility when it comes to optimizing some performance critical applications.


In practice, this is true for perhaps as much as one percent of all applications. Or rather, the claimed performance improvement is worthwhile in as much as one percent of the cases. The rest of the time, i.e. the vast majority of all times, the programmer productivity gained by not having to worry about stuff like destructors and memory allocation is a net win.

A decade or more ago, the performance penalty was real and had more impact. With modern JIT optimizations, its rare when the real world performance is an issue, its nearly always the DBMS or the Webserver or the user that is the bottleneck.

A lot of the things that are "more control" are things that humans do not do very well.

Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Pat Farrell wrote:
Fred Hamilton wrote:As I see it c++ puts more control over system resources in the hands of the programmer. As a result c++ offers a bit more flexibility when it comes to optimizing some performance critical applications.


In practice, this is true for perhaps as much as one percent of all applications. Or rather, the claimed performance improvement is worthwhile in as much as one percent of the cases. The rest of the time, i.e. the vast majority of all times, the programmer productivity gained by not having to worry about stuff like destructors and memory allocation is a net win.

A decade or more ago, the performance penalty was real and had more impact. With modern JIT optimizations, its rare when the real world performance is an issue, its nearly always the DBMS or the Webserver or the user that is the bottleneck.

A lot of the things that are "more control" are things that humans do not do very well.



Well sure, no disagreement, if programmer productivity is a prime concern, then yeah. But I was talking about cases where performance is a prime concern, and programmers that can make use of the control.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java [What are the differences between Java and C++?]