Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> What Are The Advantages Of Java Vs C++?
silverkirfsco
post Mar 6 2005, 05:58 AM
Post #1


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 73
Joined: 2-March 05
Member No.: 2,850



what are the advantages of c++ and what are the advantages of java?

what one is more userfriendly, and what one has more capabilities?
Go to the top of the page
 
+Quote Post
BabyTux
post Mar 6 2005, 02:45 PM
Post #2


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 21
Joined: 2-March 05
From: Auckland, New Zealand
Member No.: 2,849



QUOTE
Java is designed to be simple, object oriented and similar to C++ while removing the unnecessary complexities of C++. It is also said to be a robust, architecturally neutral, portable, interpreted, threaded, dynamic and high performance language. Java enables the development of robust applications on multiple platforms in heterogeneous, distributed networks. C++ is not truly portable nor is it suited to heterogeneous, distributed networks. While C++ excels in high performance, its powerful features and complexities are often the source of many errors.
Go to the top of the page
 
+Quote Post
insanedodgers
post Mar 6 2005, 05:34 PM
Post #3


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 11
Joined: 6-March 05
Member No.: 2,928



C++ is new generation computer language.

I like both : )
Go to the top of the page
 
+Quote Post
Jguy101
post Mar 7 2005, 03:44 AM
Post #4


Premium Member
Group Icon

Group: Members
Posts: 257
Joined: 28-January 05
Member No.: 2,370



Oh, and you can run Java programs and applets on any computer, no matter what the OS, as long as it's equipped with the Java Virtual Machine, which is free. biggrin.gif
Go to the top of the page
 
+Quote Post
pixelsmack
post Mar 7 2005, 08:15 PM
Post #5


Member - Active Contributor
Group Icon

Group: Members
Posts: 80
Joined: 8-January 05
From: England
Member No.: 2,047



C++ can be a very fast language when compiled hence its use in device drivers and other core applications (alongside C). Java is moer userfriendly for writing applications for that will contain a GUI as it is mostly self contained and will run completley indipendantly of system or operating system. C++ does not have this advantage and external compile files or systems may be required to run software you design, this is especially true on linux and unix.
Go to the top of the page
 
+Quote Post
silverkirfsco
post Mar 11 2005, 12:08 AM
Post #6


Member [ Level 2 ]
Group Icon

Group: Members
Posts: 73
Joined: 2-March 05
Member No.: 2,850



what one is easier to create graphics with?

and what one requires more computing power?
Go to the top of the page
 
+Quote Post
Soleq
post Mar 11 2005, 12:35 AM
Post #7


Advanced Member
Group Icon

Group: Members
Posts: 145
Joined: 4-December 04
From: California
Member No.: 1,608



It depends on what you mean by graphics. For a simple GUI, Java's Swing API is easy to use, and usually built in or included as an add-on package to install. There's another GUI API, but it slipped my mind. I always just used Swing.

Java, as stated before, can be complied to run on the JVM. This creates a multi-platform application that you can easily distribute. The only negative part about this is performance, where the JVM is often sluggish and not fully robust enough for me to trust. I'm using a Yearbook creation software for a school, and it's the most poorly designed (and hideous) program I've seen in years, and I suspect that the problems lie mostly in the Java architecture rather than program design (could be wrong, but honestly, would anyone purposefully write a program that requires you to quit the application to open a new file?) I hated the JVM, and probably always will.

C++ has its downfalls as well. It's harder to learn (generally), but more importantly, it's a ***** to actually port to other processors. Since most APIs are processor specific, you'd have to find a comparable API to fill in the gaps that can't be used again. The OOP concept is essentially the same, so that's a moot point here.

If I had to classify Java and C++, I'd say Java is for learning, and C++ is for coding. C++ has significant advantages when it comes to performance, and can smoke Java in equal settings.
Go to the top of the page
 
+Quote Post
qwijibow
post Mar 11 2005, 04:02 PM
Post #8


Way Out Of Control - You need a life :)
Group Icon

Group: Members
Posts: 1,366
Joined: 14-September 04
From: Nottingham England
Member No.: 570



QUOTE
C++ has its downfalls as well. It's harder to learn (generally), but more importantly, it's a ***** to actually port to other processors. Since most APIs are processor specific, you'd have to find a comparable API to fill in the gaps that can't be used again. The OOP concept is essentially the same, so that's a moot point here.


You mean each Operating system has its own API's.
C++ if coded with portability in mind, is very very very easy to port.
Just re-compile.

aslong as you stick to C++ standards ( for example using fstream for file access instead of microsofts FILE class, < which does exactly the same thiing as fstream, except its not portable>)

Infact, The only parts that are difficult to port between windows, and the rest of the OS's is the GUI. and this can be nullified by using the GTK, QT or SDK libraries in c++ for GUI control.

In other words... IF a c++ project is designed with portability in mind, porting is as simple as a re-compile.

ANYWAYS... advantages of Java which nobody has pointed out jet...

1) Garbage collection. in java you dont have to delete memory when you have finished with it, it is virtualy impossable to wrte a program in java which suffers from memory leaks.

2) No Raw memory access. Although c++ raw memory access is lightning fast, Java takes away memory manage,ment from the porogrammer, making it virtually impossable to make a mistake which could result in a buffer overflow vunerability.

Some aspects or very confusing though.
for example in c++ you can simply declair an array of user defined object, and begin using them..

example
CODE

myObject  objectArray[ 100 ];


BUT in java, to do the same thing you need to
CODE

myObject[ ] objectArray = new myObject[100];
for(int n=0; n<100; n++) {
   objectArray[ n ] = new myObject;
}


this is because, in the java virtual machine, line one one creates an array of 100 pointers to myObject, you then need the loop to create 100 objects and assign them to pointers

This part of the java language only makes sence if you understand memory management and pointers (which you will only get from learning c or c++)
Go to the top of the page
 
+Quote Post
Jguy101
post Mar 12 2005, 07:29 PM
Post #9


Premium Member
Group Icon

Group: Members
Posts: 257
Joined: 28-January 05
Member No.: 2,370



QUOTE(Soleq @ Mar 10 2005, 04:35 PM)
It depends on what you mean by graphics.  For a simple GUI, Java's Swing API is easy to use, and usually built in or included as an add-on package to install.  There's another GUI API, but it slipped my mind.  I always just used Swing.

Java, as stated before, can be complied to run on the JVM.  This creates a multi-platform application that you can easily distribute.  The only negative part about this is performance, where the JVM is often sluggish and not fully robust enough for me to trust.  I'm using a Yearbook creation software for a school, and it's the most poorly designed (and hideous) program I've seen in years, and I suspect that the problems lie mostly in the Java architecture rather than program design (could be wrong, but honestly, would anyone purposefully write a program that requires you to quit the application to open a new file?)  I hated the JVM, and probably always will.

C++ has its downfalls as well.  It's harder to learn (generally), but more importantly, it's a ***** to actually port to other processors.  Since most APIs are processor specific, you'd have to find a comparable API to fill in the gaps that can't be used again.  The OOP concept is essentially the same, so that's a moot point here.

If I had to classify Java and C++, I'd say Java is for learning, and C++ is for coding.  C++ has significant advantages when it comes to performance, and can smoke Java in equal settings.
*

I don't think that's the JVM's fault, it sounds more like a creation of a dumb programmer. After all, Oracle SQL was written in Java....
Go to the top of the page
 
+Quote Post
thedevil
post Mar 16 2005, 09:49 AM
Post #10


Member - Active Contributor
Group Icon

Group: Members
Posts: 82
Joined: 17-November 04
Member No.: 1,392



Let me share my knowledge about Java and C++.
C++ was here before Java came and its obvious for C/C++ to grab large portion of the market. but it does not make C/C++ the only programming language. Everyone Prefers C and C++ because it works as a middle tier of highlevel language and lowlever language. you get both power of programming at root as well as at the top. due to this popularity there are more C/C++ compiler than other languages. like GNU C++ or G++, Turbo C++, Borland C++, Devshed C++, MS C++ and many more they come in many flavour. some are specifically for windows. like VC++. I have not heard any one coding application in VC++ for Linux.
Due to this popularity C and C++ has become powerful more and more day by day and today it stands as a ruler in languages. And Microsoft had added a new flavour to C and C++ called C#. Though C# is made from the scratch. It is based on the same norm of C and C++.
C++ is handy as it supports both the structured programming and OOP. It is easy if you do not get overdriven by Pointers and end up crashing your software with an error reading "Illegal Referenc to this and that" or "Null Pointer Assignment". Memory management in C/C++ is totally on hands of a programmer. Though there are software to check the memory leaks and garbage collection. But memory management is tedious in C/C++. If you are well with Pointers and memory management then C++ should be your choice.
And talking about Graphics and others there are plugin API specially for Graphics, I think much of the graphics software or games are made in C/C++ and their other flavours.

Java is great Programming language. And I like to code in Java than in C/C++ because of its ease of use. I have heard that the codes in java are 4 times smaller than the codes written in C/C++ for the same job. Java manages memory itself by its garbage collector. and it eliminates the pointers and itself is based on references. I mean any variable you create are references. Java is easy to use for the programmers from the C/C++ background coz it has the same look and feel of coding.[The curly braces I love Curly braces{}]

Graphics in Java is good. The new JDK2 comes with more powerful Graphics API and I think you will hardly need 3rd Party API.

Moreover Java is platform independent and secure. You can port your program to any platform without any hassle.
I code Java program in windows and use it in Linux and viceversa. Its fun. you need not bother about portability as long as you have JVM running....

And there are many to follow...
Now you make choice which one is better..
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. java.lang.NullPointException(4)
  2. Java Unlimited(14)
  3. Array Sorting(21)
  4. Need Help: Find Lowest Character Using Java(7)
  5. Download Java Ebooks(13)
  6. Java By Example(8)
  7. Video Streaming In Web Browser Through Java Or Jsp(1)
  8. Looking For A Java IDE(25)
  9. Java App To Web App(12)
  10. On Why Java Is 'c'ooler!(10)
  11. How To Configure/intergrate Jboss 4 With Java?(1)
  12. Other Sound Format Support(3)
  13. Java Phone Book(2)
  14. How To Create Exe File In Java?(12)
  15. How Do I Test A Java Aplication(11)
  1. Mozilla And Java!(2)
  2. Need To Modify Xml Attribute Using Java(4)
  3. Bluetooth And Java(5)
  4. Java Sdk Vs. Java Jdk?(2)
  5. Graphcal User Interfaces In Java(4)
  6. Java Db Help Pls(2)
  7. Loading 3d Models In Java?(2)
  8. Java Applet Loading Error(5)
  9. Setting Up Java Correctly(8)
  10. Java Java.security.accesscontrolexception(6)
  11. Simple Java Question(3)
  12. Java And Sql: Data Mismatch(6)
  13. Java Memory Leak?(0)


 



- Lo-Fi Version Time is now: 5th September 2008 - 02:01 PM