Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java object based or object oriented  RSS feed

 
sriram sundararajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is java object based or object oriented language? Java will not support 100% of oops concept not like smalltalk. How are we saying that java will not support 100% oops concept and why it is not supporting?
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is object-oriented, not object-based. Older JavaScript was object-based, not object oriented.

Object-oriented: Can define or extend classes, and create (instantiate) objects.

Object-based: Can only create (instantiate) objects.


Because you are the one who posted the statement that Java is not 100% object-oriented like SmallTalk, perhaps you could tell us your reasoning.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is sort of an academic argument. In order to answer it, you need to define EXACTLY what you mean by 'object based' and 'object oriented'. depending on how you define them, the answer could be neither, both, or only one...

To the OO purist, Java does not pass the muster, because it has things that are NOT objects - the primitive data types. Some people would also say the operators make Java non-pure-OO. I believe i've read that some languages, you can only have methods (which are parts of objects), so again, Java fails that test.

but, Java does support the main OO principles...

so, unless and until everyone can agree on what your terms mean (and believe me they don't), you're not gonna get a single, defining answer.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SmallTalk is OO because the term OO was coined to describe Smalltalk. For anything else, your own opinion is as good as anybody else's.
 
sriram sundararajan
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am getting confused with all answers.
Leave about object based or object oriented, will java supports all OOPS concepts or not? If not why?
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you may be asking for a clear 100% answer for a question that has no clear 100% answers. Pretty much, if you read carefully the above responses, you'll have a consensus of the differing opinions on the subject.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12542
48
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will java supports all OOPS concepts or not?


What concepts are you interested in/worried about? Generally speaking, most people would say "Yes, Java supports OO concepts". But if you could give us a list of what YOU consider to be "all OOPS concepts", you could probably get a more definitive answer.

I'm really not trying to be a pain. but some people say "if it supports inheritence and encapsulation, it's OO".

Other would say "if you can create something that's NOT an object (in java's case, a primitive), then it's NOT OO".

So we really can't answer your question unless you clarify/define your terms.

sorry!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!