answersLogoWhite

0

How do java statements differ from c nd c plus plus?

Updated: 8/18/2019
User Avatar

Wiki User

9y ago

Best Answer

There's little point in trying to compare Java statements to C statements since C is not an object-oriented language. There are some obvious similarities, however that is only because the Java language borrowed heavily from the C++ language, while C++ evolved directly from C. Other than that, Java and C have nothing in common whatsoever.

Java and C++ are both object-oriented languages, however Java is 100% object-oriented. C++ is largely object-oriented, but because it inherits from C it also inherits all of C's fundamental data types such as int, char and, more importantly, pointer variables. Java has none of these -- everything is implemented as an object.

One key difference between Java and C++ is that, by default, objects are passed to functions by reference in Java. In C++, all variables are passed by value by default. Although it makes more sense to pass by reference, C++ must retain backwards compatibility with C, which has no concept of references whatsoever (to pass by reference in C you must pass by pointer -- but the pointer itself is passed by value). You can, of course, pass by reference in C++ using C++ references (which C does not support), but it is not by default -- that's the key difference.

Another key difference is that in Java all class methods are virtual by default. In C++, all methods are non-virtual by default. In some ways, defaulting to virtual makes a lot of sense and perhaps, with hindsight, C++ would have done the same. It's certainly a lot easier to mark a derived class as final in Java, whereas in C++ you have to manipulate the language to achieve the same end.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do java statements differ from c nd c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the answer to the operation A divided by 3 times 6 plus 4 to the Nd power?

A / 3 * 6 + 4^Nd = 2A + 4^Nd


How much does a y2k cost?

5 dollars plus tax nd shipping plus hadling not included


Is anurag and thani from star plus husband nd wife in real life?

no


Can I get a better plus size nursing bra?

bravado makes some great plus size nursing bras. They are very comfortable nd easy on the eyes.


How do you write 3 plus 01 plus 0.006 in word form?

3 + 0.01 + 0.006 = 3.016 in word form = three a nd sixtee n thousa ndths


What is the mass of 4.771E plus 22 atoms of neodymium?

4.771 X 1022 atoms neodymium (1 mole Nd/6.022 X 1023)(144.2 grams/1 mole Nd) = 11.42 grams of neodymium --------------------------------------


How are the human body different to the frogs body?

The human body is bigger and the tongues are different plus a frog is little nd green


What is the union carpenter scale in North Dakota?

Journeyman carpenters in ND make $26.50 plus $1.20 vacation so $27.70.


What was the result of territorial expansion brings people of many cultures under Chinese rule?

cuzz i did their daddys nd mammas nd grandmas nd grndpas nd thier sisters nd cuzzins nd aunts nd everybody n their family


What is the meaning of Educational background?

Requires differ from one position to another. Potenctial employees must have the knowledge and skills in reading nd understanding directions, a legible penmanship, and an accurate computation


Nigeria where is Bismarck nd in nigeria?

There is no Bismarck, ND in Nigeria! Bismarck is in North Dakota, hence, ND.


How would GTA IV run with an Intel i5 750 CPU 4GB of DDR3 1600MHz Dominator Memory XFX 4890 GPU plus Would it run on very high settings plus What kind of framerates will I be getting?

idunno i once tryd 2 da same but w/ les resolsion nd ackses memary nd work jst find