can we override constructors in java?

Discussion in 'Programming' started by rajuljain, Jun 24, 2012.

  1. #1
    java wll provide constructors overrideing?
     
    rajuljain, Jun 24, 2012 IP
  2. Magina™

    Magina™ Active Member

    Messages:
    258
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Yes you can.
     
    Magina™, Jun 29, 2012 IP
  3. Unni krishnan

    Unni krishnan Peon

    Messages:
    237
    Likes Received:
    9
    Best Answers:
    2
    Trophy Points:
    0
    #3
    Constructors are not normal methods and they cannot be overridden.

    The rule of OOPS tells that a constructor should have name as its class name.
    If we try to override superclass's constructor it will be like unknown method without return type.
     
    Unni krishnan, Jun 29, 2012 IP