- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are differences between static binding and dynamic binding in Java?
Following are the notable differences between static and dynamic binding −
Static Binding
- It occurs during compile time.
- It is observed in private, static and, final methods.
- It is known as early binding.
Example
class Super{ public static void sample(){ System.out.println("This is the method of super class"); } } Public class Sub extends Super{ Public static void sample(){ System.out.println("This is the method of sub class"); } Public static void main(String args[]){ Sub.sample() } }
Output
This is the method of sub class
Dynamic Binding
- It occurs during run time.
- It is observed in instance methods.
- It is known as late binding.
Example
class Super{ public void sample(){ System.out.println("This is the method of super class"); } } Public class extends Super{ Public static void sample(){ System.out.println("This is the method of sub class"); } Public static void main(String args[]){ new Sub().sample() } }
Output
This is the method of sub class
- Related Articles
- Difference between Static binding and dynamic binding in Java
- Static binding and dynamic binding in Java
- Difference Between Static and Dynamic Binding
- Static binding vs Dynamic binding in C#
- Static vs Dynamic Binding in Java
- Explain the difference between static and dynamic binding in Java.
- What is dynamic binding in Java?
- What is static binding in Java?
- Dynamic Binding in C#
- What is dynamic binding in C#?
- What is static binding in C#?
- What is binding and binding time in compiler design?
- What is binding in Java?
- Early binding and Late binding in C++
- What is operator binding in Python?

Advertisements