Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is difference between static method and static
variable?

Answer Posted / priyabrata patro

first let us see what is method and variable.
method is nothing but a functionality which is collection of statement.But variable is a container which contains data.
second is what is the usage of static keyword.
By using static keyword you can save memory , i mean if you declare one non static member than while creating object it will occupie memory but once you have declared one member as a static , it will not allocate memory number times rather than once.
ok , now let us find out about our question.
static mehod contains statements and where exactly you can use static variable.And it can be invoked by any methods only.
And static variable contains data which can be modified by any methods.And it can be used by method and also other variable. And one main thing about static variable is you can declare a static member as local variable.

Sorry , i could not be able to declare about static . ok , if you want to know more than contact me in this mail id priyabrata.try@gmail.com

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is java 11 paid version?

932


Why doesn't the java library use a randomized version of quicksort?

951


Why a dead thread occurs?

944


What are invisible components?.

2098


What is a singleton class? Give a practical example of its usage.

1054


What does main method?

938


Can we call the run() method instead of start()?

998


What is the method to expand and collapse nodes in a jtree?

998


From the two, which would be easier to write: synchronization code for ten threads or two threads?

1015


Can you override private or static method in java?

939


What is meant by 'bit masking' in java?

1131


can java object be locked down for exclusive use by a given thread? : Java thread

1048


Why string is a class?

904


What does sprintf return?

1020


What is a data structure java?

965