title: Getting error while overriding class variables in dart
body: <p>I have been learning dart but having some issue with the below code in which I have used default constructor to avoid taking default values inside the class as a practice but the compiler says that it is must to initialize class variables as those values can't be nullable. Is it really needed to assign class properties if my default constructor is assigning those values while initializing objects of class in the main ? Kindly help on this.</p>
  <pre><code>      class Person
        {
         String name;
         int age; 
  
          Person(String st_name, int age)
           {
            name = st_name;
            this.age = age;
           }
         }
  
     void main()
     {
      Person obj_p1 = new Person('Ralph',25);
      var obj_p2 = Person('Mark', 26);
      
      print(obj_p1.name);
      print(obj_p1.age);
      
      print(obj_p2.name);
      print(obj_p2.age);
      }
  </code></pre>