Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners What are the restriction imposed on a static method or a static block of code?
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
What are the restriction imposed on a static method or a static block of code?
1 Answer(s)      a year and 7 months ago
Posted in : Java Beginners


hi,

What are the restriction imposed on a static method or a static block of code?

Thanks


Advertisement
View Answers

April 11, 2013 at 4:17 PM


hi,

Static method can call only other static methods and static variables defined in the class. A static method should not refer to instance variables without creating an instance and cannot use "this" operator to refer the instance.

For more related to Static method in Java program

thanks,



Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com