PDA

Click to See Complete Forum and Search --> : Newbie Question.


Help
Jan 11th, 2001, 12:34 PM
What is the difference between Java and C/C++.
I know a Little C. Is Java going to be the same as C. Reason why im asking is because Im going to be taking a Java Class soon and If I learn Java well, will I easily be able to finish up learning C/C++? What is the comparison?

Thanks

Jan 12th, 2001, 02:13 PM
C++ is an extension of C like the next step in evolution of the language (as in Let C = C + 1, but in C, we can say C++).

C also has a construct called "struct" which has been evolved to include methods in C++. This new construct is called "class" which defines the blueprint for an object. An object encapsulates states (like a struct) and functionality (through methods--methods is another name for functions). C++ syntax is similar to C.

Java syntax is similar to C++ and is strongly object oriented. While you may have a C++ compiler, that didn't mean you were writing Object Oriented Programs. Java is almost 100% OOP Object Oriented Programming. The source file itself is compiled into a class file.

Building on the object concept; you might think of:
Assembly language as using grains of sand to build a house.
C/C++ as using bricks.
Java as using walls, floors, etc.

If you learned C then C++, then Java would be cake. Java has less pitfalls in compiled code, but you have to get your code compiled first. I would say that going from Java to C++ would be a steady learning curve, but you may be disapointed that you have to handle more in C++ than you had to in Java. I'd say that C to C++ to Java is a hump in the learning curve at the C++ point.

However, if you learn Java well, you may not have to go back to C++ unless you wanted optimization on specific platforms. That's another point; Java is supposed to be portable to many platforms much more than C/C++.

Help
Jan 13th, 2001, 07:19 PM
Thanks for Clearing everything up for me VirtuallyVB. :)

Help
Jan 16th, 2001, 11:55 AM
Okay Im still wondering some things about Java.

1. Can Java do everything C/C++ can do.
2. Why is it that the Java message board has very little activity. Meaning why isnt it as popular.
3. If java where the future is?

Thanks for answering my newbie questions. :)

Jan 16th, 2001, 01:49 PM
1. Can Java do everything C/C++ can do.
I would err on the side of saying, "yes", but the point is that there are existing api's, packages that can help you get the job done faster than building them from scratch with C/C++; but to be fair, there are API's for C/C++ as well. Also, I'd expect C/C++ to be faster during execution than Java. For instance, I dropped MS C++ and MS VB after I found out how to implement sockets in Java. I was personally disappointed (to say the least) with MS's products not working as documented. If I wrote a C/C++ version, I'd generally have to target a specific Operating System. If I code in Java, any Virtual Machine VM (which most browsers and O/S's have) will be able to execute my code. I have heard of a hefty price tag to convert executables to run in a browser, but Java achieves this for low cost to me. If I was going to write a computational intensive app, I'd probably go with C++.

2. Why is it that the Java message board has very little activity. Meaning why isnt it as popular.
What URL did you type to get to this web site? I'm sure there are Java sites that have minimal VB activity.

3. If java where the future is?
Even with the IDE's I've seen for Java, VB is still the fastest to get you to a finished professional looking application. But the size of the executable may be large. I think Java is the future due to networks being the future and present.

Bottom line: Be versed in many languages so that you can adapt to the needs of the market. Java was born to meet a market need, and the requirements changed before it was actually called "Java".

Good Luck!

KrishnaSantosh
Feb 10th, 2001, 05:59 AM
Well Java Is Portable When Compared To C++. But Here Are Some Of The Major Pitfalls

Since Java Is Cross Platform And Portable, You May Have To Loose Some Flexibility and Power of Programming.

Java Has totally eliminated pointers. so it is not fit for complicated Systems Programming.

Java is still in its budding stage. A Lots of improvement has to be made to improvise the product.

Java, since it is portable has no good interfaces(leave alone JNI) or implementations for library loading and linking.

Moreover since lots of security checks have to be made, your program is not fast.It lacks Optimization.

If you are programming for the web or if you want to make your program run in many platforms, select Java or else Cpp would be of greater use.

using C++ you can program complicated Systems programming very easily. Moreover You can produce highly Optimized Native Executables. C++ Is More Wider And More Powerful For Programming.

Infact Portions Of Java Was Created Using Ansi C. However Java has Its Own Advantages. Mainly Its Simplicity Over C++. The Structure Of C++ Lang is much more Complicated than Java.

EMail Me For More Details. at

santoshkrishna@santoshsmail.com

substring
Feb 13th, 2001, 08:34 AM
Compare to C and C++, Java is a higher level language. Its strength of being platform independant is also its weakness of being slow in I/O. It requires a translation layer. In order to speed up the I/O, many developers are using lex and yacc to help.

Java has a lot of potential. I just hope that we don't have to wait too long each time for Sun to come up with the "new and improved" version.

And regarding your question on the lack of activities in this forum, bear in mind that this is a Java forum *with-in* vb-world, most of the people here are primarily on Microsoft tools. If you go to the forum of a pure Java site, you will find more activities.

Just my 2 cents.

substring.