Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java and OOPs

 
Vallabhaneni Suresh Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why Java is not fully object oriented language?
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ July 26, 2005: Message edited by: Mani Ram ]
 
Qi Liang
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One reason is the primitive types, like int, double and so on.
 
Vijayendra V Rao
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vallabhaneni Suresh Kumar:
Why Java is not fully object oriented language?


Show me a program without a single class in it first and then I will answer your question! What does a class encapsulate?! Think!!!
 
Clarice Doe
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vijayendra V Rao:
Show me a program without a single class in it first and then I will answer your question!


I can't. It's a syntactic requirement of Java (you can define interfaces & enums, but they don't count as a program, for they can't function independently).

Can you now answer to the question "Why Java is not fully object oriented language?"

Originally posted by Vijayendra V Rao:What does a class encapsulate?! Think!!!


It encapsulates state and behaviour. But, what effect does that has on whether Java is OO or not.
 
Vijayendra V Rao
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Clarice Doe:


It encapsulates state and behaviour. But, what effect does that has on whether Java is OO or not.


Good stuff! A class represents the state and behavior of "something". Now what is that "something"? When we design an application, we try to split up the problem domain into a conceptual set of objects and then we write classes that represent the state and behavior of these objects within the application scope. Even to start an application you will need an object, which would be the starting point. Even this is an object from where your application kicks off.

Thats the reason why I put it up in the form of a question itself. There is no way you can write a non-object-oriented program, atleast as far as I know, in Java. Ofcourse you can have an interface or an abstract class. But what is the purpose of it?! Where will you use it?! What does it represent?! It isn't even going to have a context in such a case.

I dunno how far I have been able to express myself. But if you still have questions then shoot back
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vijayendra V Rao:

There is no way you can write a non-object-oriented program, atleast as far as I know, in Java.


Disagree. Remember that just using objects doesn't necessarily mean that it is OO.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Vijayendra V Rao:


There is no way you can write a non-object-oriented program, atleast as far as I know, in Java



Its very easy to break OO principals with Java.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even in the most OO language, it would still be simple to write a fully procedural program, so that is hardly an argument.

For elaborate discussions on how Java is lacking in OO functionality, please do search this forum - it's a very frequently discussed topic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic