• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

OOPS

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai everybody,
I'm new to java and I have few doubts in OOPS concepts

Java is not purely object oriented, then why it is expecting us to write everything inside a class?

Why Arrays are object in java?What's the benefit of having it as an object?

Why global variables are not allowed in java
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

We have many different forums here at the Ranch. This one is devoted to programming with threads. We have others that are devoted to general Java issues. I'm going to move this to our Java beginner's forum.
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Everything is an object except primitives. If an array were a primitive, how would you store objects in it?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java is not "pure" OO because it has primitives. We've had lots of discussions about what "pure" means and I for one concluded it doesn't matter and I don't care. I get paid to use Java and I'm pretty happy about that. Knowing a little about other OO languages helps me some times, but not because they are more or less "pure".

You can do pretty darned good OO with Java. The designer's decision to put all code within classes encourages us to keep trying to do better. Including an alternate structure for code outside of classes might well have a place in the world, but not in Java's.

BTW: The real answer is OO == Smalltalk because Alan Kay invented both and said so.
 
What does a metric clock look like? I bet it is nothing like this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic