Use of colon after class name in c++

前端 未结 3 391
谎友^
谎友^ 2020-12-24 07:24

This is a header file extracted from a blackberry 10 helloworld program.

#ifndef ApplicationUI_HPP_
#define ApplicationUI_HPP_

#include 

na         


        
相关标签:
3条回答
  • 2020-12-24 07:38

    The class listed after the : is what the class ApplicationUI inherits from.

    0 讨论(0)
  • 2020-12-24 07:42

    It means that ApplicationUI inherits all methods and member variables from the class QObject. The use of public means that the public methods and members of QObject are also public in ApplicationUI.

    0 讨论(0)
  • 2020-12-24 08:01

    Simple code snippet here:

    using System;
    
    namespace ProgramCall
    {
    
    class Class1
    {
    
        public int Sum(int A, int B)
        {
            return A + B;
        }
    
        public float Sum(int A, float B)
        {
            return A + B;
        }
    }
    
    class Class2 : Class1
    {
        public int Sum(int A, int B, int C)
        {
            return A + B + C;
    
        }
    }
    
    }
    
    0 讨论(0)
提交回复
热议问题