In Java, what’s the purpose of static methods and static variables?

Answer Posted / nashiinformaticssolutions

When a method or variable needs to be shared across several objects of a class, developers utilize a static keyword to make it shared for all objects. Instead of making unique copies for every object, this is employed.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is core java called?

712


What is bitwise complement?

712


Can we sort hashset in java?

850


How do you sort in java?

770


What is a loop java?

775


What is final variable?

675


Can we define static methods inside interface?

713


Does java return by reference?

734


What is the reason behind using constructors and destructors?

779


Explain about oops concepts.

843


Can we cast any other type to boolean type with type casting?

717


What is assembly language?

719


What does function identity () do?

704


What is an exception? difference between Checked and Unchecked exception in Java

755


Explain the difference between association, aggregation and inheritance relationships.

791