answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Can two classes contains member functions with the same name?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can you name the legacy classes and interface for collections?

Dictionary, Hashtable ,Properties ,Stack and vector are the legacy classes in java


What is a default package in Java?

A default package is a package with no name. You can create a Java class without putting package name on top of the code. This class is included in the "default package". Be careful not to be confused with java.lang, which is a package that contains Java's fundamental classes and get's imported by default.


How many classes should be included in each java file?

You can only have one non-inner public classes per java file and that class name must match the filename. The java file can also have any number of inner classes and anonymous classes.


What is the difference between header files and namespace in cpp?

Header files are actual files - stored in the file system, referenced by file name, and #include'd in other files (at least, in C/C++ or other languages using the M4 macro preprocessor). Header files typically group pieces of code that are all interdependent parts of the same specific item together. For instance, a game might have a header file for all of its graphics rendering. Namespaces, on the other hand, are an element of the programming language - they don't exist as a file system object, but rather as a designation within code telling the compiler that certain things are within that namespace. Namespaces typically group interfaces (functions, classes/structs, types) of similar (but not necessarily interdependent) items. For instance, the std namespace in C++ contains all of the Standard Library functions and classes.


What is a function and its types in C plus plus?

What is a function?A function is a procedure call; a re-usable block of one or more statements that can be called from any code that has access to it. Unlike a goto or a jump statement, functions automatically return to the caller when the function has completed its given task, just as if the code within the function were placed directly into your code (known as inline expansion). Functions are most useful whenever the same statements need to be called over and over from several places in your code, but without the need to duplicate that code (thus reducing maintenance costs). And since functions can call other functions, they can also be used to reduce highly complex functions into much smaller, easier to read functions.Functions also differ from goto and jump statements in that they can be parametrised. That is, arguments can be passed to the function to alter its behaviour according to a given set of parameters. Moreover, functions can also return a value to the caller. The return value is often used to return an error code to indicate the success or failure of the function, but can also be used to return any one value. If more than one value must be returned, you can either return a complex object (a class, struct or union) or you can use output parameters (parameters may be used to provide input to a function, output from a function, or indeed both).Parameters and argumentsWhen discussing functions, you will often encounter the terms parameters and arguments, often prefixed with the terms formal and actual. While many languages do not make any particular distinction between the terms, let's clarify exactly what these terms mean in the general sense.An argument is an actual parameter or actual argument that is passed to a function from the calling code. In other words, it is the actual variable or constant that you pass into a function.A parameter is a formal parameter or formal argument that always appears in a function's declaration and/or definition, and is used to accept the arguments passed to it. That is, the arguments are assigned to the parameters. Parameters are often declared but not named within function declarations, but they must be named in function definitions if the function's definition requires access to that parameter. Parameters that are declared but not named in a definition cannot be used by the definition, and are often called dummy parameters.Function SignaturesThe name of a function and the parameters it accepts determine the function's signature. The function signature is used to disambiguate functions that have the same name but different parameters, known as function overloading. The return type of a function does not form any part of its signature, thus overloaded functions cannot differ by return type alone.Types of FunctionsIn C++ there are essentially just two major types of function: external functions and member functions. A member function is also known as a method or member method, and is always declared to be a member of a class. Access to the method is determined by the class in which it is declared. External functions do not belong to any class and can be called from any function or class that has access to it.Methods can also be classified by what they do. Accessor functions are used to retrieve information from the class while mutators manipulate the information within the class. Operators are methods that perform operations upon the information (such as assignment and equality). Operators can also be used to dynamically cast objects to different classes of object or even primitive data types. Special methods known as constructors initialise the class while a destructor cleans up the class when it falls from scope. Unlike other methods and functions, neither constructors nor destructors return any value, not even void. Methods can also be further classified as being non-virtual, virtual and pure-virtual in order to provide any combination of concrete and abstract interfaces to the class.External functions usually provide auxiliary or utility functionality to a program. Such functions are usually miscellaneous in terms of their functionality and although some could be combined and classified to become member methods, the additional work required to design a class around them will often outweigh the usefulness in having the class. However, if the external functions require access to global data, it is better to combine those functions and the global data into a class, if only to eliminate the need for global data (which is generally a good thing).C++ also includes many built-in functions made available though the standard library, including template classes and functions. Combined with user-defined classes and functions, these greatly reduce the need to design your own classes and functions entirely from scratch.

Related questions

What is the name of program if you are define more than two class?

The name of your program does not necessarily have anything to do with the names of the classes you use to write it. If your project contains two classes named MyClass and MyOtherClass, you can still name your project "Awesome Program Thing" if you wanted to. Now, if you're asking this to know how to run the program, then you need to tell Java to run the class which contains your main method.


Which dialog box contains a list of predefined functions available in excel?

The Insert Function dialog box contains a list of predefined functions available in Excel. Click the Insert Function box, and in the search bar, type in a description of what you want to do. Click OK, and then browse through the functions. If you already know the name of a function, choose it from the box.


What is the name of the period that contains americium?

Americium is a member of the actinoids family of chemical elements, period 7 of the periodic table of Merndeleev.


What is a member name?

what is member name


What is the other name of functions?

circular functions


What is the name of the namespace that contains the primary data types and core classes such as the Console class?

The context seemed to be in C# or VB.Net. System is the namespace.For Java, the package (not namespace) is java.lang


Suggest name for personality development classes?

suggest the name for sarting the personality development classes


Name the social classes to which most philosophes belonged?

The philosophes primarily belonged to the bourgeoisie, which was the middle class during the Enlightenment. They were educated individuals who came from various professions such as lawyers, physicians, writers, and scholars. Some philosophes also came from the nobility or clergy.


What is the name of a line that contains points D?

name a line that contains point d


What type of inscets are in arthropods and name each inscets that is arthropods?

All insects are arthropods. The phylum Arthropoda contains the classes Insecta (insects), Crustacea (crabs, lobsters, etc), Chelicerata (arachnids) and a few others.


What are the packages used in java?

package is a logical container that contains logically related classes interfaces and sub packages. Concept of package is use to provide a unik name space to class as well as to enforce scope.


What functions get executed when you inherit from a class with the same functions name?

In general, the child class's functions will be used in place of the parent.