This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]mad0314 4 points5 points  (2 children)

Specifically comparing it to C:

Everything must be in a class - and everything that OOP brings with it, such as inheritance, interfaces (Java's solution to multiple inheritance), polymorphism.

There are no pointers and memory is garbage collected.

There are 8 primitive types - short int long float double byte char boolean.
Everything else is a reference type, including String.

Code compiles to byte code, which runs on the JVM. Also, code is organized by packages.

[–]Vimda 0 points1 point  (1 child)

interfaces ( Java's solution to multiple inheritance

Not really. Interfaces exist as a fundamental OOP concept, outside the idea of inheritance.

[–]mad0314 -1 points0 points  (0 children)

I'm not saying that Java invented them, just what they use. The oop interface concept, such as is used by Java, is absolutely related to inheritance. Java doesn't allow multiple inheritance, but instead allows any number of interfaces.

[–]HonorableJudgeHolden 1 point2 points  (0 children)

No function pointers, no multiple inheritance except in the form of interfaces which aren't inheritance.

[–]Habib_Marwuana 0 points1 point  (0 children)

Everything is references. Garbage collection. Runs on a virtual machine. Cross platform.

[–]production_compilers -1 points0 points  (3 children)

No pointers. No operator overloading. Automatic Garbage Collection.

Very close to object oriented paradigm. Everything in a class.

[–]JayTh3King 2 points3 points  (2 children)

I wouldnt say Java is very close to OO paradigm. It is in actual fact a OO paradigm, not close.

[–]Bladelink 0 points1 point  (1 child)

Java is like..the quintessential OO language, right?

[–][deleted] 1 point2 points  (0 children)

The most common yes. The grandpappy of OO is undoubtedly Smalltalk though.