answersLogoWhite

0

It depends on the language. Java provides the Objectsuperclass (defined in java.lang) from which all other classes must be derived. This allows us to treat any Java object as being "of the same type". This is not necessarily a good thing -- separate types should be kept separate -- however garbage collection would be difficult to implement without a common base class to refer to every type of object.

C++, on the other hand, is not a "pure" object-oriented language; it is a multi-paradigm (procedural, object-oriented and generic). Programmers are free to decide for themselves how to classify user-defined objects, but the built-in types (such as int and double) are not derived from classes, so there can be no superclass. If there were, it would not be possible to write (let alone support) low-level C-style code where there can be no classes of any type. In addition, the standard library types (such as vector and string) have no superclass. In particular, a vector and a vector cannot be regarded as being "of the same type" even if U derives from T. If we really require this functionality, we can easily cater for it in code, but it isn't provided by default (via a superclass) because the language itself does not require it.

User Avatar

Wiki User

∙ 8y ago

What else can I help you with?

Related Questions

Which class includes all the others?

Super class in object oriented programming


What is the super clas of class?

All Java classes with no defined superclass, extend from java.lang.Object.


What is C-Sharp equivalent for Java's Object main superclass?

System.object is the base class of all other classes in the .NET framework.


Why do you use superclass init method inside your init method in a servlet?

Because, that is how all Java classes work. When a class is initialized/created all the classes it extends from (its super classes) need to be initialized as well.


What is sub class in Java?

A sub class is paired up with its super class. These can also be called a child and parent class.The subclass will inherit all of the variables and methods from its superclass. And one superclass can have multiple subclasses, but a subclass can only have one superclass.Here's an example:public class childName extends parentName {...}This means that childName will inherit everything from its superclass, which is parentName.The advantage of this inheritance is that you do not need to copy/paste lots of code for many similar subclasses, and if you want to change something you only need to make one change in the superclass.


What happens if an abstract modifier is applied to class. Explain?

The classes which have one or more abstract methods are abstract. To declare a class as abstract, use the abstract keyword in front of the class keyword, before the class declaration. Abstract classes cannot be instantiated. Similarly the new keyword cannot be used to create an object of the abstract class. Remember that the constructors and static variables cannot be declared as abstract. Any subclass of an abstract class must either implement all of the abstract methods in the superclass or be itself declared abstract.


What is the superclass of a rio grande leopard frog?

The Rio Grande leopard frog (Lithobates berlandieri) belongs to the class Amphibia, which is its superclass. Within this class, it is further categorized under the order Anura, which includes all frogs and toads. The term "superclass" typically refers to a higher taxonomic rank, but in this context, Amphibia serves as the broader grouping that encompasses various amphibian species, including frogs.


What portions of a super class can be used by subclass?

Any members of a superclass which are declared as public or protected can be used by all subclasses.


what class is the top of awt event hierarchy?

The top of the Abstract Window Toolkit (AWT) event hierarchy in Java is the java.awt.AWTEvent class. This class serves as the superclass for all AWT events, encapsulating the common properties and methods shared by various event types. Specific event classes, such as ActionEvent, MouseEvent, and KeyEvent, extend AWTEvent to handle distinct types of user interactions.


Which is the topmost class in java?

The "Object" class is the topmost class in the class hierarchy. Classes inherit directly from this class by default; all classes inherit from Object directly or indirectly.


What is the Christianity social class?

Within Christianity all people are just considered children of God, thus there are no "social classes" within Christianity.


Are amphibians and reptiles and birds and mammals all in the same class?

No, not in a straight forward traditional classification sense... Amphibians = class Amphibia Reptiles = class Reptilia Bird = class Aves Mammals = class Mammalia They can be categorized all together in the "superclass" Tetrapoda.

Trending Questions
What is a software that allows users to organize data in rows and columns and perform calculations on the data? In excel how can you write capital letters in cell without using caps lock? Can't get app To respond? Which type of printer actually touches the surfaces of the paper? The file is a hidden text file stored in the root directory of the active partition that Ntldr reads to see what operating systems are available and how to set up the boot? How many cubic feet is in a 36x36x96 box? What do you do if a red exclamation mark appears on your Windows 7 files. message me at ejmaestresgmail.com for a picture? When a router receives a packet with destination address that is within an unknown subnetwork of a directly attached network what is the default behavior if the ip classless command is not enabled? Is1024 GB 1TB? What is the halfway point from Niagara Falls NY to Alexandria VA? What are methods of data distribution? When i use my logitech webcam instead of taking a video of me it shows is screen that says webcam max which i want to get rid of how do it do that? How do you address a friend who is your age? Should legacy hardware be added to windows 7 PC? What components leads to slow computer performance when it becomes outdated? How many centimeters in 3.5 decimeters? What city is the halfway point between Toronto and Winnipeg? How do you charge a APC Back-UPS Pro? How do you removed a virus that keeps rebooting your computer even after reinstalling WinXP Pro and formatting the hard drive? Is downloading music from MyMusicInc.com illegal?