Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Differents between object and static object

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 29-01-2010
Member
 
Join Date: Dec 2009
Posts: 41
Differents between object and static object
  

Hi Friends,

I am java beginner with lots of confusion about the objects. I am confused between object and static object. According to my knowledge objects are nothing but the instance of class. But the objects and static objects are toe different concept. Please let know some differences between the Static object and object. I am waiting for your reply.

Reply With Quote
  #2  
Old 29-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Differents between object and static object

Hi,

An object can be declared with static storage class using the static or extern keyword. Local objects must be explicitly declared as static or extern to have static storage class.Static object is an object is which doesn't work on ordinary methods.All global objects (objects declared outside all functions) have static storage class. You cannot declare static instances in a tiny-model program.
Reply With Quote
  #3  
Old 29-01-2010
Member
 
Join Date: May 2008
Posts: 2,008
Re: Differents between object and static object

Static object is an object is which doesn't work on ordinary methods. An object can be declared with static storage class using the static or extern keyword. one more thing to note static method can only able to acess static variables. Local objects must be explicitly declared as static or extern to have static storage class. All global objects have static storage class. You cannot declare static instances in a tiny-model program.
Reply With Quote
  #4  
Old 29-01-2010
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Differents between object and static object

Software objects are conceptually similar to real-world objects. If any object is declared as STATIC. It shares the Memory space for the instances of that object.but in the case of simple object The separate memory space will b created for each instances. An object stores its state in fields and exposes its behavior through methods. An object is made from a class; a class is the blueprint for the object. An object stores its state in fields and exposes its behavior through methods.
Reply With Quote
  #5  
Old 29-01-2010
Member
 
Join Date: May 2008
Posts: 2,293
Re: Differents between object and static object

When a static object is declared with an initializer that does not evaluate to a constant expression, the object is given the value 'zero' at the point before execution enters the block for the first time. Local objects declared as static are initialized the first time their declarations are encountered in the program flow. However, the object is not visible and no constructors are called until the actual point of declaration.
Reply With Quote
  #6  
Old 29-01-2010
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: Differents between object and static object

There are many different kinds of Java Objects, and in fact a big part of programming in Java is creating your own types of Objects. Object is an instance of a class. Methods operate on an internal state of the object and serve as the primary concept for the object-to-object communication. To create a new type of object that you can use in your Java programs, you have to provide a blueprint of sorts that Java will use to create new Objects of this type. This blueprint is called a Java class.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Differents between object and static object"
Thread Thread Starter Forum Replies Last Post
Getting HP AIO Device object server register class object failed message on my system Donoho Hardware Peripherals 6 06-06-2011 02:34 AM
Scope of Object or variable in Object oriented Programming Languages Dėfrim Software Development 3 08-01-2011 06:20 AM
static methods in object oriented programming Satchel Software Development 5 07-01-2011 09:58 PM
Object reference not set to an instance of an object KAIRU26 Software Development 3 05-09-2009 09:14 PM
Object test = new Object() <-- Java, best way in C++ ADISH Software Development 3 25-10-2008 03:32 PM


All times are GMT +5.5. The time now is 05:52 PM.