<< Chapter < Page Chapter >> Page >

Condo is analogous to an object

Each condo unit is analogous to an ordinary Java object .

Each set of blueprints delivered to the construction site is roughly analogous to an object of the class named Class . In other words, each set of blueprints describes one or more condo unitsconstructed from that set of blueprints.

When construction is complete

When the construction project is complete, the contractor delivers a set of blueprints for each type of condo unit to the management firm that has beenhired to manage the condo complex. Each set of blueprints continues to be analogous to an object of the class named Class . The blueprints remain at the site of the condo units.

RTTI

Thus, information regarding the construction, wiring, plumbing, air conditioning, etc., for each condo unit (object) continues to be available at the site even after the construction has been completed. (This is somewhat analogous to something called runtime type information and oftenabbreviated as RTTI. A Class object contains RTTI for objects instantiated from that class.)

What are those analogies again?

In the above scenario, each condo unit is (roughly) analogous to an object instantiated from a specific class (set of blueprints).

Each set of blueprints remaining onsite after construction is complete is roughly analogous to a Class object that describes the characteristics of one or more condo units.

What do you care?

Until you get involved in such advanced topics as reflection and introspection , you don't usually have much involvement or much interest in Class objects. They are created automatically, and are primarily used by the Java virtual machine during runtime to help it do thethings that it needs to do.

An exception to that rule

However, there is one area where you will be interested in the use of these Class objects from early on. You will be interested whenever variables or methods in the class definition are declared to be static .

Class variables and class methods

According to the current jargon, declaring a member variable to be static causes it to be a class variable . (Note that local variables cannot be declared static . Only member variables can be declared static .) Similarly, declaring a method to be static causes it to be a class method.

Instance variables and methods

On the other hand, according to the current jargon, not declaring a variable to be static causes it to be an instance variable , and not declaring a method to be static causes it to be an instance method .

In general, we can refer to them as class members and instance members .

What is the difference?

Here are some of the differences between class and instance members insofar as this discussion is concerned.

How many copies of member variables exist?

Every object instantiated from a given class has its own copy of each instance variable defined in the class. (Instance variables are not shared among objects.) However, every object instantiated from a given class shares the same copy of each class variable defined in the class. (It is as though the class variable belongs to the single Class object and not to the individual objects instantiated from that class.)

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Object-oriented programming (oop) with java. OpenStax CNX. Jun 29, 2016 Download for free at https://legacy.cnx.org/content/col11441/1.201
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?

Ask