• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is java a object oriented or purely object oriented?  RSS feed

 
Rohit Sidana
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hii.....Today one of my friend asked me that tell me whether Java is a object oriented language or purely object oriented language.....I gave a straight away answer that it is purely object oriented language...then he started laughing and told me not to give such a straight away answer think just upon that...So guys please tell me whether i was right or wrong?
 
naved momin
Ranch Hand
Posts: 692
Eclipse IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rohit Sidana wrote:Hii.....Today one of my friend asked me that tell me whether Java is a object oriented language or purely object oriented language.....I gave a straight away answer that it is purely object oriented language...then he started laughing and told me not to give such a straight away answer think just upon that...So guys please tell me whether i was right or wrong?

you are right java is pure oo language because everything in java goes under class including the main() method but this is not the case with c++ in c++ we write main() method outside the classes which we have declared above
like so here if we romove class then it is similar to c language
but in java this not true a main() method has to come in a class and that class name should be the name of your file

hope this helps
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Stay Hungry Stay Foolish
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question does not make sense without a definition of what, exactly, a "pure OO language " is. There are certainly languages that are more OO than Java, because it has elements that are not objects - like primitive variables.

As an aside, this particular question has been asked many, many times in the past; please use the Search link at the top of the page to find all the previous discussions.
 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would say java is not purely Object Oriented.

Everything in purely Object Oriented should be classes, but we have primitive datatypes in java.

Java doesn't support multiple inheritance directly. Even though it does using Interfaces, it is a indirect way.

 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMO, multiply inheritance is not a defining characteristic of OO. C++ has it, but that's not exactly a model OO language. SmallTalk doesn't, and it's very close to what I would consider a pure OO language (yes, it can be faked, but that's about the same as saying multiple interfaces in Java mean multiple inheritance).
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!