hamburger menu
All Coursesall course arrow
adda247
reward-icon
adda247
    arrow
    arrow
    arrow
    Which of the following can be overloaded?
    Question



    Which of the following can be overloaded?

    A.

    Variable

    B.

    Objects

    C.

    Class

    D.

    Function

    Correct option is D

    Function overloading is a feature in programming languages like C++ that allows multiple functions to have the same name but differ in their parameter types, numbers, or both. This enables the same function name to perform different tasks based on the context.
    Important Key Points:
    1. Overloading increases code readability and reusability by using the same function name for different purposes.
    2. The compiler differentiates overloaded functions by their signatures (number and types of parameters).
    3. Overloading is specific to functions and operators, not variables or classes.
    Knowledge Booster:
    1. Variable: Cannot be overloaded because variables must have unique identifiers in the same scope.
    2. Objects: Are instances of classes and do not support overloading.
    3. Class: Does not support overloading directly, though methods within a class can be overloaded.
    4. Function overloading is different from function overriding, which occurs in inheritance when a derived class redefines a base class function.

    Free Tests

    Free
    Must Attempt

    MPTET Varg 3 PRT Mock 01

    languageIcon English
    • pdpQsnIcon150 Questions
    • pdpsheetsIcon150 Marks
    • timerIcon150 Mins
    languageIcon English
    Free
    Must Attempt

    MPTET Varg 3 PRT CDP Subject Test 01

    languageIcon English
    • pdpQsnIcon20 Questions
    • pdpsheetsIcon20 Marks
    • timerIcon20 Mins
    languageIcon English
    Free
    Must Attempt

    UPTET Paper 2 Social Science : PYP Held on 23rd Jan 2022 (Shift 2)

    languageIcon English
    • pdpQsnIcon150 Questions
    • pdpsheetsIcon150 Marks
    • timerIcon150 Mins
    languageIcon English
    test-prime-package

    Access ‘UPSSSC JE’ Mock Tests with

    • 60000+ Mocks and Previous Year Papers
    • Unlimited Re-Attempts
    • Personalised Report Card
    • 500% Refund on Final Selection
    • Largest Community
    students-icon
    383k+ students have already unlocked exclusive benefits with Test Prime!
    Our Plans
    Monthsup-arrow