List of Object using Inheritance

Viewed 33

I'm trying to get multiple students records but I have no idea. Problem: get multiple dynamic records using the list of objects with inheritance I have tried a list of objects also and inheritance also but there seems to be no solution. I have searched the problem on google but no solution.So

class stdbasic{                                   //parent class
        void getbasic(){}
        void putbasic(){}
}                                 
class stdresult extends stdbasic{                 //child class
        void getresult(){} 
        double putresult(){}
        void pass(){}
}               
main(){
        stdresult std=new stdresult();            //creating obj of child class
        std.getbasic();                           //method calling
        std.getresult();
        std.putbasic();
        double x=std.putresult();
        std.pass(x);                              //to check the students performance
}

this code run successfully and my next task is to create a code that can take multiple dynamic inputs from the user and display (output);

0 Answers
Related