top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Steps To Initialize Constructor

0 votes
231 views

1 Basic initialization
1.1 Allocate memory for the complete object
1.2 Initialize all instance variables to their default values (0 or null)

2 Call constructor: Trader("Jack", "Sales")
2.1 Bind constructor parameters: n="Jack", d="Sales"
2.2 No explicit this() call
2.3 Call super(n) for Employee(String)-Employee Here means parent class and Trader is child class
2.3.1 Bind constructor parameters: n="Jack"
2.3.2 Call this(n, null) for Employee(String, Date)
2.3.2.1 Bind constructor parameters: n="Jack", DoB=null
2.3.2.2 No explicit this() call
2.3.2.3 Call super() for Object()
2.3.2.3.1 No binding necessary
2.3.2.3.2 No this() call
2.3.2.3.3 No super() call (Object is the root)
2.3.2.3.4 No explicit variable initialization for Object
2.3.2.3.5 No method body to call
2.3.2.4 Initialize explicit Employee variables: salary=5000.00;
2.3.2.5 Execute body: name="Jack"; date=null;
2.3.3 Execute body: No body in Employee(String)
2.4 No explicit initializers for Trader
2.5 Execute body: department="Sales"

posted Mar 14, 2014 by Pavan P Naik

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button

...