adspace
What is the difference between static method and instance method in Java?
Answer Posted / Pranjul Shrivastava
In Java, static methods belong to a class as a whole, while instance methods belong to individual objects of the class. Static methods are called using the class name, don't have access to instance variables (as they are shared among all instances), can't be overridden by subclasses, and can only call other static methods or static variables. Instance methods are called using object references, can access both instance and static variables, and can override methods from superclasses.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
explain different ways of using thread? : Java thread
Realized?
What is an object in java and how is it created?
Is minecraft 1.15 out?
What is the difference between equals() and == in java?
What is a constructor overloading in java?
What is java string pool?
Write a program to print count of empty strings in java 8?
Write a program to find the whether a number is an Armstrong number or not?
How to sort array in descending order in java?
What do you mean by an interface in java?
What is a classloader in java?
What is the difference between break and continue statements?
What is parsing in java?
Explain public static void main(string args[]) in java.