• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is JAVA is fully Obj Oreinted?  RSS feed

 
Mahesh Pinnamaneni
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai dudes,
As i got doubt when i was working with multiple inheritence prob.i got doubt that is java is fully object oreinted or partly.becoz some says that multiple inheritence is partial in java.with this does java become partly Obj Oriented?
plz clear my doubt possibly with an example.

thanks alot
regards,
Mahesh P
 
Petr Blahos
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mahesh,

I have a better question: Why would it matter?

Seriously, what does it change if it is or if it is not?
Now, read your favorite definition of an OO language and
you should be able to tell whether Java is OO or not (with
regards to your "favorite" definition).

As to multiple inheritance: I don't see how this particular
issue would have a effect on a language being object oriented
or not.

Java has primitive types that are not objects (or that are
not instances of classes, or whatever) but that does not
make it a non object oriented language.

You see, the beauty (or the uglyness) of your question is
that people could argue about that for ages without actually
reaching a common agreement.

It is more important to realize that you may write an object
oriented program in Assembles and also that you might write
a program in java (or eiffel or maybe even smalltalk) that
isn't OO.

Best regards,
Petr
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To me a language is object-oriented if it supports the three pillars: encapsulation, inheritance and polymorphism. Java does all three pretty elegantly.

I've heard the expression "a true object-oriented language". Is that the same as "fully object-oriented"? I wouldn't say that Java fits that label, but nor does it aspire to. I imagine in a "true" OO language, everything would be an object; there'd be none of this dodgy package level (default) access or objects of one class having access to the private members of other objects of the same class. Would there be multiple inheritance? I dunno - probably. I honestly think that Java takes a pragmatic approach to OO and provides the useful capabilities while bending the restrictive rules that actually make development harder, not easier.

As Petr says, though, I think much of this discussion is academic. What's really important is that Java enables you to get the job done in an elegant and efficient way.

Jules
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many purists argue that "Java is not fully object-oriented" because it contains 8 data types that are not objects.

I'll let you form your own opinion on that.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!