aspose file tools*
The moose likes Java in General and the fly likes is java 100% object oriented Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "is java 100% object oriented" Watch "is java 100% object oriented" New topic
Author

is java 100% object oriented

bapi kumar
Greenhorn

Joined: Aug 27, 2005
Posts: 8
hi all, i want to know whether java is 100% object oriented? if yes how? if no why?
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

"javaCloud in Earth" -

Please review our naming policy. JavaRanch requires that you use your real name when posting in the Saloon.

Please do not multiple the same question multiple times or in multiple forums. JavaRanch is a collection of interested volunteer Java users. There is no obligation for any one here to answer question, much less in a timely manner.
[ August 27, 2005: Message edited by: Michael Ernest ]

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8764
    
    5
I'd say Java embodies 'practical OO', not pure OO. For example, if it was pure OO then primitives would be objects.


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Patrick van Zandbeek
Ranch Hand

Joined: Aug 17, 2005
Posts: 37
Also, static methods wouldn't exist in pure OO. Don't believe, try asking a person that doesn't exist to wash your dishes for you and you'll see what I mean.


u is a letter, not a word.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Of course the phrase "100% OO" doesn't have any defined meaning, anyway.

But I agree that there are definitely "more OO" languages than Java out there. For example, in Smalltalk even things like for loops and if statements are method calls.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The term "object oriented" and Smalltalk were invented at the same time to define each other, so that's probably about as good as it gets. I saw that Alan Kay (the inventor) was just laid off in the HP downsizing. I hope we don't see him on a corner with a "Will program for food" sign.

Smalltalk is all about sending messages. I wish we had kept that terminology in other OO languages.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Stan James:
The term "object oriented" and Smalltalk were invented at the same time to define each other, so that's probably about as good as it gets. I saw that Alan Kay (the inventor) was just laid off in the HP downsizing. I hope we don't see him on a corner with a "Will program for food" sign.

Smalltalk is all about sending messages. I wish we had kept that terminology in other OO languages.


I agree!

Wasn't it Alan who said something along the lines of "When I invented the term OO, I hadn't something like C++ in mind..."
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

OO programming is a style not a language.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Mr. C Lamont Gilbert:
OO programming is a style not a language.


Well, I agree to the point that you can write OO programs in non-OO languages, and non-OO programs in OO languages. Still a language can support OO programming to different degrees, so asking what a language *does* support, and where it might lack some support, might be kind of reasonable, don't you agree?
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

The simplest definition for "pure" OO is whether only objects are permitted. In Java you have eight primitive types; end of story.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I'd also add that everything is a method call. As Ilja mentioned Smalltalk doesn't even have "if". In Java "if a == b" has no method calls. I only did Smalltalk for a couple months in 1995 so I'm sure I don' have it right, but it reads more like:

a == b true { code }

Call the == method on a with b as an argument, get back a boolean. Call the true method on the boolean with { code } as an argument and maybe it executes the code. The actual "syntax" of Smalltalk is far smaller than Java's; most of it is written in itself.

This is an entertaining discussion that we go around on every once in a while. I find everyone's answers interesting and educational, but the answer is of little real value. Java is an appropriate langauge for many tasks, it supports a lot of good OO ideas, but it's up to the designer to make something good out of it. You an make a better or worse OO design in a more or less OO language. The more OO langauges may help you out more, though, so if "100% OO design" is a goal, maybe choose Smalltalk, work in it for 20 years, and you'll get there.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Stan James:
a == b true { code }


More like

a == b ifTrue: [code]



What makes this powerful is that you can, of course, use the same mechanism to invent your own constructs. It's very elegant, and something I miss in Java (even though my experience with Smalltalk is near to zero...)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is java 100% object oriented
 
Similar Threads
Mohammed Amine Elmrabe
Object Oriented and Object based
Is java is purely object oriented or not?
Hi, All i have a small doubt
silly question but very important