Explain the importance of "static"keyword

Showing Answers 1 - 21 of 21 Answers

Harika Reddy

  • Sep 19th, 2005
 

Hi can i join?

  Was this answer useful?  Yes

satheesh

  • Sep 19th, 2005
 

static keyword ,means only one copy per class if u have a static block or static method it will run first then only other statements like constructor will run . it dosen't need an object to access its method .Though u can access it using object u can access it using class nameso using object is eliminated.

Belurgikar sunil

  • Sep 29th, 2005
 

A method if needed to handled independent of any objects then it should be declred as static. static block is executed before main method. we can aceess static method by classname.ex.Integer.ParseInt is  a static method

  Was this answer useful?  Yes

Devidas Sonawane

  • Oct 19th, 2005
 

static is used to to call any method and inner class without any instance of class. it executes before main methods.

  Was this answer useful?  Yes

sandeep

  • Nov 7th, 2005
 

static is one per class instead of one per object

  Was this answer useful?  Yes

sus

  • Apr 29th, 2006
 

Belurgikar sunil Wrote: A method if needed to handled independent of any objects then it should be declred as static. static block is executed before main method. we can aceess static method by classname.ex.Integer.ParseInt is  a static method

  Was this answer useful?  Yes

antara

  • Mar 30th, 2007
 

Hi,

i think static keyword makes the variable retain its value even after the end of the block.

static function can be used without instantiating it.

  Was this answer useful?  Yes

bsandiprec

  • Jul 5th, 2007
 

Static fields are created once per class, and all instances of the class see the same values for those fields. For non-static fields, each instance gets its own copy that it can manipulate independently of any other instance's copy.

  Was this answer useful?  Yes

vishalchat

  • Feb 23rd, 2008
 

Static menthods, variables or block is executed in the order they are written in the class while class is getting loaded. Static methods are variables can be invoked without creating an object of the class. There is only one instance of the variable in the JVM.

  Was this answer useful?  Yes

sampra

  • Mar 6th, 2008
 

Static menthods, variables or block is executed in the order they are written in the class while class is getting loaded. Static methods are variables can be invoked without creating an object of the class. There is only one instance of the variable in the JVM.this is for whole program only one copy will be used and sharable for all rthe object for this we can use memory  and we can invoke the static variable and static method with the only call name here no need of object createion

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions