answersLogoWhite

0

What is the use of base keyword?

Updated: 10/23/2022
User Avatar

Wiki User

15y ago

Best Answer

Using base in a derived class invokes the base class's corresponding method.

For example, something like:

class Shape{

public void print(){printf("Generic shape");

...

}

class Triangle:Shape{

public void print(){printf("Triangle");

...

}

int main()

{

Triangle x;

x.print(); // Should print "Triangle"

x.base.print(); // Should print "Generic shape"

return 0;

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the use of base keyword?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the use of keyword new used in AWT programming?

what is the use of new keyword in awt programming


What does the keyword extends mean in BlueJ?

The "extends" keyword in Java is how you declare a subclass.class Base {void foo() {}}class Sub extends Base { //Sub is now a subclass of Basevoid begin(){Sub s = new Base(); //cannot do this the other way around!}}


What are the 6 ways to use this keyword?

"Java This keyword" is a reference to the current object, it is very helpful when you need to refer an instance of a particular Object from its available methods or using it's constructor, also "this" keyword helps us to avoid naming conflicts.The following are different ways to use java this keyword1) Using with instance variable2) Using with Constructor3) Pass / Return current instanceUsing with instance variableUsing this keyword inside a method or constructor it will use instance variable instead of local variable, in the absence of this keyword it will use local variableUsing with instance variableUsing this keyword inside a method or constructor it will use instance variable instead of local variable, in the absence of this keyword it will use local variableUsing with ConstructorUsing this keyword inside constructor like followingthis("Sony", 20); it will call the constructor having same parameter


Is super keyword is analogous to this keyword in java?

No. The keyword super is used to refer to the parent class instance while the keyword this is used to refer to the current class instance. You need to learn about Inheritance and Object creation using constructors to learn more about these keywords and their use


What is use of keyword extra in c plus plus programming?

Nothing.

Related questions

What is the use of keyword new used in AWT programming?

what is the use of new keyword in awt programming


Which keyword do you use to deallocate memory that has been assigned to a stream object?

Delete keyword


Can you declears static in a local variable in a method in java?

we cannot use the staic keyword inside the method... But we can use the final keyword inside the method....


What does the keyword extends mean in BlueJ?

The "extends" keyword in Java is how you declare a subclass.class Base {void foo() {}}class Sub extends Base { //Sub is now a subclass of Basevoid begin(){Sub s = new Base(); //cannot do this the other way around!}}


What are the 6 ways to use this keyword?

"Java This keyword" is a reference to the current object, it is very helpful when you need to refer an instance of a particular Object from its available methods or using it's constructor, also "this" keyword helps us to avoid naming conflicts.The following are different ways to use java this keyword1) Using with instance variable2) Using with Constructor3) Pass / Return current instanceUsing with instance variableUsing this keyword inside a method or constructor it will use instance variable instead of local variable, in the absence of this keyword it will use local variableUsing with instance variableUsing this keyword inside a method or constructor it will use instance variable instead of local variable, in the absence of this keyword it will use local variableUsing with ConstructorUsing this keyword inside constructor like followingthis("Sony", 20); it will call the constructor having same parameter


How many keywords you can use for link building?

You can use many keyword for link building, but you should use an LSI keyword so, you will better to give links on your keyword. The idea is to find as many qualifiers as possible that fit your audience. http://socialseoteam.com/link-building-2015.php


Is super keyword is anologous to this keyword in java?

No. The keyword super is used to refer to the parent class instance while the keyword this is used to refer to the current class instance. You need to learn about Inheritance and Object creation using constructors to learn more about these keywords and their use


Is super keyword is analogous to this keyword in java?

No. The keyword super is used to refer to the parent class instance while the keyword this is used to refer to the current class instance. You need to learn about Inheritance and Object creation using constructors to learn more about these keywords and their use


What does google adwords keyword tool mean?

Adwords is an advertising product. It has various ways to advertise text, banners, and rich-media commercials.The AdWords Keyword Tool is an incredibly useful and powerful keyword research tool, built into the AdWords interface. Now it is known as "Keyword Planner". Many Google Partner Agencies like Radon Media as well as businesses who are running online advertising campaigns on Google use this tool to search for keyword and ad group ideas, see how a list of keywords might perform, and even create a new keyword list by multiplying several lists of keywords together. Keyword Planner can also help you choose competitive bids and budgets to use with your campaigns.The AdWords Keyword Planner supports three key use cases:Search for keyword and ad group ideasEnter or upload keywords to get estimatesMultiply keyword lists to get estimates


What is a Keyword Management System?

The Keyword Management System(KMS) is• A Software system for the selection, creation, registration and maintenance of InternalKeywords and Keyword Identifiers• It is implemented by a Website system that intends to use the Keyword Identifier for addressing• Maps a Keyword Identifier with the address of the Internet data location(s) (the URLs)• Registration and maintenance takes place within the computer server hosting the Website• URLs can also be local network computer addresses for Intranet users• Website owners and members have total control over the mapping process• One Internal Keyword or Keyword Identifier can be mapped to multiple URLs• Multiple Internal Keyword's or Keyword Identifiers can be mapped to one URL• Multiple Internal Keyword's or Keyword Identifiers can be mapped to multiple URLs• Can maintain the attributes and behavior of Internal Keyword or Keyword Identifier and URLsImplementing the Keyword Management System• Generate and use hundreds of relevant Internal Keywords and Keyword Identifiers• Use the Keyword Identifiers as a standardized form of addressing• Have complete control over your Electronic Resource addressing• Accuracy of Keyword-based addressing for your Electronic Resource• Empower each and every page within your Website System• Information stored deep within Website Systems can get the same visibility as the domain name• Provide a efficient and user friendly address for your dynamic content• Can be implemented by Small Business to Large Corporate Website Systems• Choose what Electronic Resources to display for each Keyword Identifier


What is use of keyword extra in c plus plus programming?

Nothing.


What keyword is used to find derivative in C plus plus?

The lazy way is to use a dynamic cast. The correct way is to use virtual functions in the base class. That way you don't ever need to know the derived type -- it simply does what is expected of it.