Difference b/w a static variable and an instance variable?, JAVA Programming

Class variables are named as static variables. There is only single occurrence of a class variable per JVM per class loader. When a class is operated the class variables are initialized.

Instance variables are non-static and there is single occurrence of an instance variable in each and every class instance. A static variable is used in the singleton pattern. A static variable is used with a final keyword to define constants.

 

 

62_Untitled.png

 

Posted Date: 7/25/2012 2:14:03 AM | Location : United States







Related Discussions:- Difference b/w a static variable and an instance variable?, Assignment Help, Ask Question on Difference b/w a static variable and an instance variable?, Get Answer, Expert's Help, Difference b/w a static variable and an instance variable? Discussions

Write discussion on Difference b/w a static variable and an instance variable?
Your posts are moderated
Related Questions

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

In Java everything exists within a class. It describes the behavior of the class and its characteristics. Java applications and applets are built in the class. Rules present for cl


In the airplane program, you may have noticed that the loading of each image appears to be jerky, erratic, or slow, and that the URL for each image flickers in the status bar each

Write an application that uses an Array to store 10messages of type String. You will store this Array with 10 messages of your choosing. For example, a message could be “I love Jav

In programming, what is an object? Object is a named collection of properties (data and state) & methods (instructions, behaviour). Objects are key to understanding object-orie

Write a program to proove that HashSet maintains random order

Are constructors inherited ? Can a subclass call the parent class constructor and When?

write a program to find the minimum no of colors to fill a board where some of the elements of different color are already placed.