# super Keyword -1

{% embed url="<https://youtu.be/pnd8tZ-9_R8>" %}

{% hint style="success" %}
The **super** keyword  is a reference variable that is used to refer immediate parent class objects
{% endhint %}

{% tabs %}
{% tab title="Example -1 " %}

```dart
void main() {
  
  
  //super keyword -1 
  var manager1 = Manager();
  
  
  manager1.id =1;
  manager1.firstname="John";
  manager1.lastname="Doe";
  manager1.dayworked=30;
  
  manager1.project ="Alpha";
  
  manager1.salary(20);

  
  
  
  
}

class Employee {
  int id;
  int dayworked;
  String firstname;
  String lastname;

  String fullname() {
    return this.firstname + " " + this.lastname;
  }

  void salary(int perDaywage) {
     print(this.dayworked * perDaywage);
  }
}




// Manager Class 


class Manager extends Employee {
  
  
  //property 
   String project;
 
  
  //Method 
  
  String manageproject(){
    
    return "Managing project " + " " + this.project; 
  }
  
   
  @override
   void salary(int perDaywage) {
     
     super.salary(perDaywage);
    print((this.dayworked * perDaywage)+30);
  }
  
 
}



```

{% endtab %}

{% tab title="Example -2 " %}

```dart
void main() {
  
  
  //super keyword -1 
  var manager1 = Manager();
  
  
  manager1.id =1;
  manager1.firstname="John";
  manager1.lastname="Doe";
  manager1.dayworked=30;
  
  manager1.project ="Alpha";
  
  print(manager1.salary(20));

  
  
  
  
}

class Employee {
  int id;
  int dayworked;
  String firstname;
  String lastname;

  String fullname() {
    return this.firstname + " " + this.lastname;
  }

  int salary(int perDaywage) {
    return (this.dayworked * perDaywage);
  }
}




// Manager Class 


class Manager extends Employee {
  
  
  //property 
   String project;
 
  
  //Method 
  
  String manageproject(){
    
    return "Managing project " + " " + this.project; 
  }
  
   
  @override
   int salary(int perDaywage) {
    return ((this.dayworked * perDaywage)+30 -super.salary(perDaywage));
  }
  
 
}



```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eece.gitbook.io/mist-innovation-club-flutter-course-1/dart-fundamentals-1/inheritance/super-keyword.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
