How do you call a constructor for a parent class?

Ads
 

How do you call a constructor for a parent class?

How do you call a constructor for a parent class?

View Answers

November 15, 2010 at 2:45 PM

Hi everyone,

You can call parents class constructors by using parent keyword.

Example :

class parent { function __construct(){ // some code } }

class child extends parent { function __construct() { parent::__construct(); // some code } }

Thanks


November 15, 2010 at 2:46 PM

Hi everyone,

You can call parents class constructors by using parent keyword.

Example :

class parent { function __construct(){ // some code } }

class child extends parent { function __construct() { parent::__construct(); // some code } }

Thanks

Ads









Related Tutorials/Questions & Answers:
How do you call a constructor for a parent class?
call a constructor
Advertisements
How do you define a constant?
Calling Constructor in Spring
Calling Constructor in Spring
How do you pass a variable by value?
How do you add a numerical value to a regex
how do you parse by reference in java(with JGrasp)
how to create a jar file for my packages classs - Struts
How do you map Java Objects with Database tables?
how do i make a phone call from my app without quitting my application
how do you change the message box to a specific color
how to call the parent page from child without refreshing the parent and my parent window uses the master page
how to call the parent page from child without refreshing the parent and my parent window uses the master page
how to call the parent page from child without refreshing the parent and my parent window uses the master page
How to call servlet in JSP?
in an application one task has to done for every 15 minutes ? How con you do it?
how to do this?
What do you understand by JPA?
What do you mean by Deadlock?
how to call static method
how to call static method
how to call static method
how to call static method
how to call static method
how to call static method
how call ireports in jsp
What do you mean by Serialized?
how to call jsp from flex
constructor
How to call print dialog box through JMenuItem?

Ads