aspose file tools*
The moose likes Beginning Java and the fly likes Is Java pure object oriented Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is Java pure object oriented" Watch "Is Java pure object oriented" New topic
Author

Is Java pure object oriented

babu kiran
Greenhorn

Joined: May 17, 2005
Posts: 1
Hi,

Is the java a pure object oriented language. If not, please give me reasons. and what are native libraries.
Hoping quick reply...
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11230
    
  16

What do you mean by "Pure Object Oriented language"? people disagree on what this term means, so no answer can be given.

if you want to find more info, just search this very forum for that phrase. it gets asked at least once a month.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Robert Hill
Ranch Hand

Joined: Feb 24, 2006
Posts: 94
People may argue about specifics about what that term means, but it is very hard to say java is. The reason is simple, there are data types that are not objects(primitives), and if you really wanted to, you never have to use objects.

native libraries are libraries that are native to a language. The java library is one, the C++ standard and template libraries are another. Something to note about them, they are not always the best solution to a specific problem, so going outside of them for things like data structures, or even writing your own in necessary. The generic nature of them makes them useful but usually at a performance cost.

It is a fairly rare occurence that you need something else, but that fact and the fact that learning how to use libraries does not a programmer make.
ak pillai
author
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
It gives you all the benefits of an OO language:

�Re-use of previous work: using implementation inheritance and object composition.

�Real mapping to the problem domain: Objects map to real world and represent vehicles, customers, products etc: with encapsulation.

�Modular Architecture: Objects, systems, frameworks etc are the building blocks of larger systems.

Also, you can complement it with AOP (Aspect Oriented Programming). Supports
inheritance, encapsulation and polymorphism. That is good enough for me to build build applications

with increased quality and reduced development time. If 90% of the new application consists of proven existing components then only the remaining 10% of the code have to be tested from scratch. In theory anyway.


java j2ee job interview questions with answers | Learn the core concepts and the key areas
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
Originally posted by Robert Hill:
People may argue about specifics about what that term means, but it is very hard to say java is. The reason is simple, there are data types that are not objects(primitives), and if you really wanted to, you never have to use objects.


In fact, Object is not even a type in Java.
Paul Santa Maria
Ranch Hand

Joined: Feb 24, 2004
Posts: 236
fred said it best. Asking "Is Java Object Oriented" is a silly question that gets asked way too often, and generally doesn't help anybody learn anything about Java, about "OO" ... and one that certainly doesn't help anybody design or program any better.

Sigh...

PS:
Hopefully the question "What are native libraries?" was answered to your satisfaction. My answer would be:

"Native Libraries" are functions written in another language, and executed
outside of the JVM. Native libraries are usually written in C or C++,
and usually do something that would be inefficient - or impossible -
to do directly in Java. Native functions are invoked using "JNI"
(Java Native Interface).
[ March 01, 2006: Message edited by: Paul Santa Maria ]

Paul M. Santa Maria, SCJP
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
It might be a useful question if it makes the original poster research and think about what "object oriented" is and is not. My personal view of "pure OO" is everything is an object and every operation is a message. In my short exposure to SmallTalk it seemed very pure and self consistent in this way, but I won't venture a percentage pure.

I think the Java/OO community lost a lot of meaning when it moved away from the "message" vocabulary. I liked reading "1 + 2" as sending the message "+ 2" to the "1" object. It seems to encourage me to think about "ask, don't tell" designs.


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
Stan, very well said!


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
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Originally posted by Stan James:
I liked reading "1 + 2" as sending the message "+ 2" to the "1" object.

sending the message "+" to the object "1" with the data "2".
...not that I advocate the Smalltalk nonsense.


Tony Morris
Java Q&A (FAQ, Trivia)
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Tony Morris:
...not that I advocate the Smalltalk nonsense.[/QB]


I'd find it easier to listen to what you advocate if you wouldn't label everything else as "nonsense"...
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The name of a Smalltalk method is the method and the parameters, so I think of it as the "+ 2" or "+ n" message. Not that it matters in this discussion. Smalltalk has a certain inner beauty; the fact that it was so totally backwards from what I knew before - from syntax to design - was quite challenging and exciting. I was disappointed we did not continue with it and it didn't catch on better in the industry. I think we'd all "get" this OO stuff better if we worked so backwards all the time.
Paul Santa Maria
Ranch Hand

Joined: Feb 24, 2004
Posts: 236
There's an extremely interesting interview with Alan Kaye (the inventor of Smalltalk) - with much discussion of what he likes (and dislikes) about Java here:

http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273&page=2
Rusty Shackleford
Ranch Hand

Joined: Jan 03, 2006
Posts: 490
Thank you for posting that, it was very interesting.

"Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves."

Truer words have never been spoken.


"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Yes, very interesting article!

Some years ago, I attended a presentation on Squeak at a conference. The veterans attending nearly burst into tears that they typically had to use Java instead...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is Java pure object oriented