aspose file tools*
The moose likes Beginning Java and the fly likes Please clarify ? Is class a physical entity ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Please clarify ? Is class a physical entity ?" Watch "Please clarify ? Is class a physical entity ?" New topic
Author

Please clarify ? Is class a physical entity ?

ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146
I say class is a logical entity !

And objects are the physical entities of a class.

Classes are represented in memory in the form Objects.

Object's hold memory representation and classes do not hold that.

Am i correct about this statements.

I will put my question if you clarify my statements then.


Discussion - the powerfull way to excellence!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14338
    
  22

I don't know what you mean exactly with the terms "logical entity" and "physical entity". As far as I know these are not terms that are used very commonly in the Java world.

A class is a blueprint for objects: it describes how a certain kind of objects look (what data the objects made out of the class have and what operations you can do on that data).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ronald Schild
Ranch Hand

Joined: Jun 09, 2008
Posts: 117
Well, you could consider a class as the place where the logic is and call it the logical entity. But a class can also contain data that is shared by all the objects, so there's also some storage going on (or something physical as you say it).

In any case, there's always only 1 of a certain class and there can be multiple objects that are based on that class. They hold specific instance data. But the class and the objects are all in memory (how would a function be called if a class didn't exist in memory?).

The way one could see it, objects hold the actual data of things that play a role in the world of the user and the class contains the functionality to work with that data.


Java hobbyist.
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
Originally posted by ram kumar:
I say class is a logical entity !

And objects are the physical entities of a class.


Fine. You can say that.

The terms "logical entity" and "physical entity" do not have any agreed meaning in the world of Java. Therefore, you can define them however you like. Do not expect others to know your definitions.


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146
Originally posted by Jesper Young:
I don't know what you mean exactly with the terms "logical entity" and "physical entity". As far as I know these are not terms that are used very commonly in the Java world.

A class is a blueprint for objects: it describes how a certain kind of objects look (what data the objects made out of the class have and what operations you can do on that data).


Hi Jasper,

As you said class is blueprint of objects, Agreed !

I too mean the same by saying logical entities.

Now i will put my question !

I had a doubt like, when class is said as blue print and only objects are physical entities.

How do static methods work ?

Now, everybody says that class exists in memory.

So, static methods will work with ease.

You mean to say that the .class file will be loaded in memory and not just the static methods ?

But i dont know why they have given the term "Blue print"

in the sun java link as

http://java.sun.com/docs/books/tutorial/java/concepts/class.html

A blue print is always a model of the real object.

A blue print is never real.

Hope, you got me.

THis is where i was
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11475
    
  16

ah, but a blue print IS real. I can go to any architect's office and find dozens if not hundreds of them.


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

Joined: May 22, 2008
Posts: 146
Originally posted by fred rosenberger:
ah, but a blue print IS real. I can go to any architect's office and find dozens if not hundreds of them.


Hey cool, I mean to say that a blueprint of a house is not the house exactly

Right?

Its a model on a piece of paper.

Class is a blueprint(something like that is in paper)

Object is the real (The house itself)

Please correct if am wrong about my assumptions.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39784
    
  28
Originally posted by ram kumar:
a blueprint of a house is . . . a model on a piece of paper.

Class is a blueprint(something like that is in paper)

Object is the real (The house itself).
Agree. But an object on a computer only exists as charges on silicon or magnetisation on the hard drive.
ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146
Originally posted by Campbell Ritchie:
Agree. But an object on a computer only exists as charges on silicon or magnetisation on the hard drive.


so you mean to say class is also a physical entity.

Blueprint key word is just for the understanding.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

I think what we mean -- because several people have said it already -- is that the terms "logical entity" and "physical entity" can mean whatever you'd like them to mean, because they have no standard meaning in Java. Note that you'd have the same confusion if you were talking about things in the real world. A blueprint is a physical object that embodies a logical concept -- a plan for a house. A house is a physical object that embodies a logical concept: a lifestyle, the way in which people are intended to use it. See? It's a mess.


[Jess in Action][AskingGoodQuestions]
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
so you mean to say class is also a physical entity.


When you compile a Java source file, you create a "class" file. The class file is the blueprint. If you consider a "file" to be someting "physical", then a class is certainly a physical entity.

An instance of a class (aka object) is a temporary, in-memory implementation of the class.

To compare with the database world.

1. A class is equivalent to a table.

2. An object is equivalent to a record in the table.
[ June 20, 2008: Message edited by: James Clark ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39784
    
  28
What EF-H means is that we are straying on the boundary betweeen "physical" and "metaphysical." Stick with the notion of blueprint as mentioned earlier, and don't make things more complicated than they already are.
ram kumar
Ranch Hand

Joined: May 22, 2008
Posts: 146
Originally posted by Campbell Ritchie:
What EF-H means is that we are straying on the boundary betweeen "physical" and "metaphysical." Stick with the notion of blueprint as mentioned earlier, and don't make things more complicated than they already are.




Thanks, all. EFH , campbell and all. for clarifying.

Understood, java is a seperate world all terms are explanatory, to some extent. but has a different specific meaning by itself.

Java specific meaning.

thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39784
    
  28
Originally posted by ram kumar:
Thanks, all.
You're welcome
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please clarify ? Is class a physical entity ?