--%>

Explain Static variable

Static variable: It is a static variable defined within a class body. Such a variable fits in to the class as a whole, and is, thus, shared by all objects of the class. The class variable may be employed to define the default value of an instance variable, for illustration, and would probably as well be stated as final, too. They are too employed to contain dynamic information which is shared among all instances of a class. For instance the later account number to be assigned in a bank account class. The care should be taken to make sure that access to share the information, like this is synchronized where multiple threads could be included. Class variables are too employed to provide names to application-wide values or objects as they might be accessed directly through their containing class name instead of an instance of the class.

   Related Questions in Programming Languages

  • Q : Define Class scope Class scope :

    Class scope: Private variables stated outside the methods in a class contain class scope. They are available from all methods within a class, in spite of the order in which they are stated. The private methods too contain class scope. Variables and me

  • Q : Explain the difference between RAM and

    Explain the difference between RAM and ROM?

  • Q : Define the synchronization objects

    Define the synchronization objects. Ansewr: A synchronization object is use to co-ordinate the execution of many threads.

  • Q : Overloading and overriding in the

    Illustrate the difference between overloading and overriding in the programming language?

  • Q : Define Final class Final class : This

    Final class: This is the class with final reserved word in its header. A final class might not be extended by the other class.

  • Q : What is Protected access Protected

    Protected access: Protected access is accessible to a class member prefixed with protected access modifier. This member is accessible to all classes stated within the enclosing package, and any sub-classes expanding the enclosing class.

  • Q : Persistent and non-persistent objects

    Illustrate the difference between persistent and non-persistent objects in the programming?

  • Q : What is Disk drive Disk drive : It is a

    Disk drive: It is a hardware device employed to store the data. They come in numerous forms, like floppy disks, compact disks, and hard disks.

  • Q : What is Variable Variable : It is the

    Variable: It is the memory block of specific size where value can be stored and modified throughout program execution. Example: int x, float y, float amount, char c;

  • Q : What is Stack overflow Stack overflow :

    Stack overflow: Stack overflow takes place whenever too many items are pushed onto a stack with a finite or limited capacity.