• class (class correlation & super class)

     /**


    Welcome to GDB Online.

    GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,

    C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.

    Code, Compile, Run and Debug online from anywhere in world.


    */

    print("good morning boss!!!")


    print("hey good morning!!!....lets start...")



    class employee {

        

        var name = ""

        var salary = 0

        var role = ""

        

        func dowork(){

            

            print("i'm doing work here...!")

            

        }

        

        

    }



    class manager: employee {

        

        func managing(){

            

            print("i'm managing people & also firing them")

            

        }

        

    }


    var a = manager()

    a.name = "UTSAV THAKKAR"

    a.salary = 20000

    a.role = "manage_P"



    print(a.name)

    print(a.salary)

    print(a.role)

    a.dowork()

    a.managing()



  • 0 comments:

    Post a Comment

    GET MORE PRODUCTS

    We are providing best products.