|
|
#2 (permalink) |
|
Cloud's Hair Spray
|
No definately not. There's loads of differences between Java and C++. For instance, Java is an OO language, C++ can be used to program OO.
But the biggest difference when it comes to variables would be that C++ has pointers and Java does not. At least not in a way that you can directly manipulate them. |
|
|
|
|
#4 (permalink) |
|
Staff Admin
|
hmm if you are talking about the basics, they are almost the same. As in the way you program and think. Pointers are considered beginner as well but we will exclude that. Any ways they are close but not any where near the same, if you can read one you can read the other.
__________________
![]() ![]() Moderator since Aug 2004. I am a guy. Email me at lothia@gmail.com FFXI Tsukisa: 60pld/30War (retired) The OnRPG War |
|
|
|
|
#5 (permalink) | |
|
Olpah's Object
|
Quote:
by the what is the use of include [iostream] name spacestd; Class Car every time i compile that..its says the Class Car is incorrect... |
|
|
|
|
|
#6 (permalink) |
|
Staff Admin
|
hmm no idea what a Class car is, I havn't done C++ for a while but the include [iostream] if I remember correctly is automaticly adding a premade file which allows you to do the cin, cout etc.
In java you do not require anything like that, but you create everything in classes. How ever variables are the same as far as I have noticed. Not any different ones in either, Arrays are different in how you call them though (but that holds multiple variables)
__________________
![]() ![]() Moderator since Aug 2004. I am a guy. Email me at lothia@gmail.com FFXI Tsukisa: 60pld/30War (retired) The OnRPG War |
|
|
|
|
#7 (permalink) | |
|
Olpah's Object
|
Quote:
for variables is salary a variable? i talk to my professor about this..he doesnt answer me..i dont know why.... i bet he hates me dunno? gee lothia..if i have some questions i post a thread here regarding C++ thanks |
|
|
|
|
|
#8 (permalink) |
|
Staff Admin
|
hmm well you can have a variable called salary.
It would probably be a double. Which would be called by double salary; or double salary = <value> hmm thats java actually but last time I checked calling them is the same.
__________________
![]() ![]() Moderator since Aug 2004. I am a guy. Email me at lothia@gmail.com FFXI Tsukisa: 60pld/30War (retired) The OnRPG War |
|
|
|
|
#9 (permalink) |
|
Marios's Mustache Wax
Join Date: Aug 2006
Posts: 11
Reputation: 10
|
Java and C++ same? Nope, they aren't. They are both based upon C but that doesn't make them same. The major differences are that C++ supports Multiple Inheritance and Genericity while Java doesn't and Java supports persistence which C++ doesn't. Java is a pure Object Oriented Language while C++ isn't (it can only be used to program OO, its not pure OOP). C++ has pointers, not Java. And pointers are important, that's what makes C++ programs faster and efficient than Java ones when the size gets bigger. You include header files like #include <iostream> in preprocessor in C++, not Java. In Java, you use something like import java.lang.*;. There's major syntactical difference between the languages too. Java boasts that programs can be made by using shorter codes than C++, and it does require less amount of code than C++. Other than these major differences though, they are much similar. That doesn't mean they are same though, heck, if they were same, Java, (most of the) programs made by which can run easily inside a web browser would have overtaken C++ ages ago.
|
|
|
| Thread Tools | |
| Display Modes | |
|
|