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
Java static method
What is the importance of static variable?
Java static method example
static
Static
What is static factory pattern?
Static method in java - Java Beginners
When will you define a method as static?
static
Static Method in java with realtime Example
static
Why is the main method declared static?
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?
Can we declare a static variable inside a method?
What is the difference between static and dynamic SQL?
what is static synchronizes - Java Interview Questions
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
What is Static Website
Static
Static keyword in public static void main
static keyword in java
static methods
static keyword
public static void main
PHP Late Static Binding
static

Ads