What is static variable and static method?
Answer Posted / ahmad
Static variables are those variables that are declared with
static keyword of java.Static variables are declared once
into a class and are available entire class.Static variables
are common to all objects of class.Static variables can be
accessed by non-static methods.Whereas Static methods are
those which are declared with static keyword and can only be
accessed static variables.If we have Static method then we
can call it directly with class_name.And static variables
and methods both are related to class,whereas non-static
variables and methods are related to object.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is difference betweem home interface and remote interface?
How to calculate the length of a singly linked list in java?
Explain some best practices you would apply while using collection in java?
What do you understand by casting in java language?
What is the synonym of string?
What is the difference between yield() and sleep()?
How would overload a function based on return type?
Is age a discrete variable?
What is the static field modifier?
How to display arraylist values in java?
What are the special characters?
What is boolean strategy?
Explain the difference between an object-oriented programming language and object-based programming language?
Why parameters should be passed by reference?
what is mena by object block any what is the use of that