Tuesday, March 7, 2017

Tell about static and instance class members?


  • When a class member includes a static modifier,the member is called as static member.When no static modifier is present the member is called non-static or instance member.
  • Static members are invoked using class name where as instance members are invoked using instances(objects) of the class.
  • An instance member belongs to specific instance(object) of a class.If we create three objects of a class we have three sets of instance members in the memory, where as there will ever be only one copy of the static member,no matter how many instances of a class are created.

No comments:

Post a Comment

Call a function in child component from parent component in React

Consider the following parent component class Parent extends React.Component { constructor(props) { super(props);         thi...