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

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,









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
Static Method in PHP - PHP
What is the importance of static variable?
static
Java static method
Java static method example
Static
What is static factory pattern?
static
static
Static method in java - Java Beginners
static
When will you define a method as static?
Static Method in java with realtime Example
Why is the main method declared static?
Example of static method
What is the difference between a static and a non-static inner class?
can we inherit static method in java?
What is the difference between static and dynamic SQL?
what is static synchronizes - Java Interview Questions
Can we declare a static variable inside a method?
What happens to the static fields of a class during serialization?
PHP set static Method
What happen when we write static public void instead of public static void?
Accessing non-static members through the main method in Java.
Static Variable
static in java
static functions
static keyword
Static
What is Static Website
Static keyword in public static void main
static keyword in java
static methods
static keyword
static
PHP Late Static Binding
STATIC VARIABLE DECLARATION

Ads