
Quick Contact
Java Tutorial
- What is Java?
- History of Java
- Hello Java Program
- Features of Java
- Basic Syntax
- Java Setup
- Data Types in Java
- Java Variables
- Operators in Java
- JVM
- Java If-else Statement
- Switch Case Statement
- Java Loops
- Do-While Loop
- Java While Loop
- Continue Statement
- Break Statement in Java
- Constructors in Java
- Oops Concept in Java
- Features of OOPs
- Inheritance
- Exeception handeling
- Aggregation (HAS-A relationship) in Java
- Method Overriding in Java
- Method Overloading
- Java Static Keyword
- Java This Keyword
- Java Final Keyword
- Polymorphism
- Static Binding and Dynamic Binding
- Abstract class in Java
- Access Modifiers in Java
- Difference between abstract class and interface
- Interface in Java
- Garbage Collection in Java
- Java Package
- Encapsulation
- Serialization and Deserialization in Java
- Java Inner Classes
- Java Applets
- Multithreading in Java
- Thread Priorities in Java
- Thread Creation
- Inter Thread Communication
- Wrapper Classes in Java
- Java Input Output
- Java AWT Introduction
- Java Layout Manager
- Java Layout Policy
- Java AWT Events
- Collection Framework
- Collection Framework List Interface
- Swing in Java
- Swing Utility Classes
- Swing Layout Managers
- Java JDBC
- Hibernate Framework Overview – Architecture and Basics
Springboot
- Spring Environment Setup
- Spring Boot CRUD REST API Project using IntelliJ IDEA | Postman | MySQL
- Dockerizing Spring Boot Application | Spring Boot Docker Tutorial
- spring-boot-restapidocumentation with swagger
- Spring Boot HttpClient Overview
- Apache HttpClient POST HTTP Request Example
- Apache HttpClient PUT HTTP Request Example
- Apache HttpClient DELETE HTTP Request Example
- Apache HttpClient HTML Form POST Request Example
- Spring Boot JSP Exampl
- Deploying Spring Boot WAR file with JSP to Tomcat
- Spring Boot Annotations
- Spring Core Annotations
- Spring MVC Annotations with Examples
- Spring Scheduling Annotations
- Spring - Java-based Container Configuration
- Spring Java Based Configuration Example
Hibernate
- Hibernate 5 hello world
- Hibernate- One to One Unidirectional Mapping Annotation Example
- Hibernate - Batch Processing
- Hibernate - Interceptors
- Hibernate 5 - Create, Read, Update and Delete (CRUD) Operations Example
- Hibernate Transaction Management
- Hibernate One to Many Unidirectional Mapping Example
- Hibernate One to Many Bidirectional Mapping Example
- Hibernate Many to Many Annotation Mapping Example
- Hibernate Primary KeyJoin Column
- Hibernate First Level Cache with Example
- Hibernate XML Configuration Example with Maven + Eclipse + MySQL Database
- Hibernate Java Configuration Example
- JPA 2 with Hibernate 5 Bootstrapping Example
- JPA and Hibernate Cascade Types
- Hibernate/JPA - Primary Key Generation
- Hibernate 5 - Enum Type Mapping Example
- Hibernate Component Mapping
- Hibernate Object States – Transient,Persistent and Detached
- Hibernate 5 - Save an Entity Example
- Hibernate 5 - Persist an Entity Example
- Hibernate 5 - saveOrUpdate() Method Example
- Hibernate 5 - get(), load() and byId() Method Examples
- Hibernate 5 - merge() Example
- Hibernate 5 - Delete or Remove an Entity Example
- Hibernate 5 - load() Method Example
- Hibernate Session Interface Methods
- Hibernate Session.clear() Method Example
- Introduction Of Java strutes to Architecture
- Struts 2 - Architecture
- Struts 2 - Configuration Files
- Struts 2 - Actions
- Struts 2 - Interceptors
- Struts 2 - Results & Result Types
- Struts 2 - Value Stack/OGNL
- Struts 2 - File Uploading
- Struts 2 - Database Access
- Struts 2 - Validations Framework
JAVA FX
- JavaFX Tutorial
- Introduction to JavaFX Pane
- JavaFX Popup
- JavaFX group
- JavaFX Controller
- JavaFX Gradient Color
- JavaFXAnchorPane
- JavaFXTabPane
- JavaFX Scene
- JavaFX Stage
- JavaFXWebView
- JavaFX Timeline
- JavaFX Timer
- JavaFX Image
- JavaFX Background
- JavaFX dialog
- JavaFX Font
- JavaFXTextArea
- JavaFXObservableList
- JavaFX GUI
- JavaFX FXML
- JavaFXEventHandler
- JavaFXGradle
- JavafxScrollpane
- JavaFXAPI
Static Binding and Dynamic Binding
Static Binding
When all the code is bound during compilation that binding is known Static Binding. When an object type is resolved at compile time, then it is called static binding.
Static binding is limited, and it may lead to difficulty in software maintenance. Static binding is formed private, final or static method in a class.
Example of Static Binding
class CarDrive{ public static void Drive() { System.out.println("CarDrive by boy"); } } class Driving extends CarDrive{ public static void Drive(){ System.out.println("CarDrive by girl"); } public static void main( String args[]) { CarDrive obj = new Driving(); CarDrive obj2 = new CarDrive(); obj.Drive(); obj2.Drive(); } }
Output
CarDrive by boy
CarDrive by boy
In the above example, we have two classes CarDriving and Driving. Both the classes have same method CarDriving(), but the method is static, which means it cannot be overriden so even though I have used the object of Driving class while creating object obj, the parent class method is called by it because the reference is of CarDriving type (parent class). So whenever a binding of static, private and final methods happen, type of the class is determined by the compiler at compile-time and the binding happens.
Dynamic Binding
Dynamic Binding is an alternative approach to Static Binding. When an object type is resolved at run-time then it is called dynamic binding. The binding of variables to routines (or methods in object-oriented programming terms) is done at run time.
Example of Dynamic Binding
class CarDrive{ public void Drive() { System.out.println("CarDrive by boy"); } } class Driving extends CarDrive{ public void Drive(){ System.out.println("CarDrive by girl"); } public static void main( String args[]) { CarDrive obj = new Driving(); CarDrive obj2 = new CarDrive(); obj.Drive(); obj2.Drive(); } }
Output
CarDrive by girl
carDrive by boy
This is the same example that we have seen above. The only difference here is that overriding is actually happening in this example since these methods are not static, private and final. In case of overriding the call to the overridden method is determined at runtime by the type of object thus late binding happens. The output is different than what we saw in the static binding example, because in this case while creation of object obj the type of the object is determined as a girl type, so the method of girl class is called. Remember the type of the object is determined at the runtime.
Difference between Static Binding vs Dynamic Binding
Now we discuss difference between Static Binding vs Dynamic Binding in Java.
- Static binding is arrived at compile time whereas Dynamic binding is arrive at runtime.
- The binding of variables to operations at compile time whereas the binding of variables to operations at run time.
- The binding of overloaded methods is static whereas the binding of overridden methods is dynamic.
- Binding of private, static and final methods always happens at compile time. When the method overriding is actually happening and the reference of parent type is assigned to the object of child class type then such binding is resolved during runtime.
Apply now for Advanced Java Training Course