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

Ads
 

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

hi,

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

Thanks

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,

Ads









Related Tutorials/Questions & Answers:
What are the restriction imposed on a static method or a static block of code?
JAVA what is different between static block and public static void main(String a[]) method
Advertisements
Static method
static method
STATIC
Can we replace main() with static block or with other static methods?
Static Method in Java
how to call static method
how to call static method
how to call static method
how to call static method
how to call static method
how to call static method
What is the importance of static variable?
static
Static
What is static factory pattern?
static
static
When will you define a method as static?
static
Static Method in java with realtime Example
Why is the main method declared static?
What is the difference between a static and a non-static inner class?
can we inherit static method in java?
Can we declare a static variable inside a method?
What happen when we write static public void instead of public static void?
static in java
Static Variable
Accessing non-static members through the main method in Java.
static functions

Ads