Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JAVA is a pure OO language?

 
Vijeth Konanavar Bhadrappa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Yesterday my friend asked me that Everyone say JAVA is a pure OO language but in java we are accessing the public static void main(String[] a){} outside any class and more over without creating an instance of that class containing that main()..... Still i am not getting the answer for this.. Someone help me out please..........
[ August 18, 2008: Message edited by: Bear Bibeault ]
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes,java is 100% pure Object Oriented Programming.

Can you write a program without a class in java?

Hope This Helps
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, Java has too much cruft from C, which was needed to ensure acceptance.
Things like

are not OO, they are pure C.

Smalltalk is an example of a pure OO language.

Why do you ask? its usually a troll. Similar to which is a better religion: Catholic or Lutheran. There is no rational way for anyone to answer this.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question has no answer, unless you define what "100% OO language" is. Different people have different definitions.

It has also been asked many, many times. Please use the Search link at the top of the page to find the previous discussions.

Yes,java is 100% pure Object Oriented Programming.
Can you write a program without a class in java?

This just shows that Java is not 0% OO - it has classes. But it also has primitives that are not objects, so it's definitely not 100%.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf and Pat ... i got it
[ August 18, 2008: Message edited by: seetharaman venkatasamy ]
 
Vijeth Konanavar Bhadrappa
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Pat Farrell and Ulf Dittmer. I got the answer.
 
Rob Spoor
Sheriff
Pie
Posts: 20608
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now all you need to do is read your private messages.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:

This just shows that Java is not 0% OO - it has classes.


Early Visual Basic had classes and was "0% OO". (As far as I remember, they called it "object based".)

One thing that makes Java "not 100% OO" is that classes aren't objects (as they are in, for example, Smalltalk).
 
Gaurav Chauhan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is not PURE OBJECT ORIENTED LANGUAGE it is HYBRID OBJECT ORIENTED LANGUAGE.

SMALLTALK, RUBY and PYTHON are Pure OO.

In java we can use primitive types int,char which are not classes but in pure OO each and everything has to be a class or object.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15438
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But Python has built-in functions that are not part of any class. So Python is also not 100% OO.

The thing is, that there is no exact definition of what is "OO" and what is not "OO". Almost all practical programming languages have a mixture of features, and since the definition of "OO" is not exact, the idea whether a language is "100% OO" or not is a matter of opinion rather than a matter of fact.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic