What is static variable and static method?

Answer Posted / govardhani

A static variable is a variable who's single copy in memory
is shared by all objects,so any modifications to the static
variable will modify it's value in all objects.

In classes, a static method is one that is called without an
instance of that class, while a non-static method is called
by instances of the class.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of using javap?

722


What is object class in java?

576


What are the difference between string, string builder, and string buffer in java?

633


List some java keywords sun like c, c + + keywords?

679


What are different exception types exceptions available in java ?

588






What are multiple inheritances? Is it supported by java?

554


What happens if main method is not static?

588


What is ternary operator? Give an example.

695


How do generics work?

611


Can a lock be acquired on a class in java programming?

627


What is output buffer?

657


What is the advantage of functional interface in java 8?

614


What is final method?

689


Why is java architectural neutral?

719


Is null an object java?

642