answersLogoWhite

0


Best Answer

It depends on the size of the object and the amount of (virtual) memory available. However, the size of an object is not determined by the amount of memory it physically occupies, but by the amount of memory it consumes. For example, a resource handle object occupies at least one word of memory, but the resource it refers to consumes additional memory. The sizeof operator only returns the size of memory occupied by the object itself, not the total memory consumed by the object.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

There is no explicit limit, but the amount of your (virtual) memory does limit that.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

There is usually no limitation, except for the amount of available memory.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

There is no theoretical limit, although pressumably any practical implementation will have limitations, depending on available memory among others.

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
3y ago

1

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many objects of a given class can there be in a program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

When you make a c program in c language then how many types class are required?

It depends on what you mean by 'types class'. Here is the shortest C program, without any 'types class': int main (void) { return 0; }


What is static variable in the class for c plus plus?

Static member variables are local to the class. That is, there is only one instance of a static member variable, regardless of how many objects are instantiated from the class. As such, they must be declared inside the class, and defined outside of the class.


What are the major types of high level programming languages?

he High Level Language is basically classified into 3 types namely:Procedural LanguageFunctional LanguageObject Oriented LanguageProcedural Language:The most common high-level languages today are procedure-oriented languages. In these languages, one or more related blocks of statements that perform some complete function are grouped together into a program module, or procedure, & given a name such as "Procedure A." If the same sequence of operations is needed elsewhere in the program, a simple statement can be used to refer back to the procedure. In essence, a procedure is just a mini-program. A large program can be constructed by grouping together procedures that perform different tasks.Procedural languages allow programs to be shorter and easier for the computer to read, but they require the programmer to design each procedure to be general enough to be used in different situations.Functional Language:Functional languages treat procedures like mathematical functions and allow them to be processed like any other data in a program. This allows a much higher and more rigorous level of program construction. Functional languages also allow variables-symbols for data that can be specified and changed by the user as the program is running-to be given values only once. This simplifies programming by reducing the need to be concerned with the exact order of statement execution, since a variable does not have to be redeclared, or restated, each time it is used in a program statement. Many of the ideas from functional languages have become key parts of many modern procedural languages.Object Oriented Language:Object-oriented languages are outgrowths of functional languages. In object-oriented languages, the code used to write the program and the data processed by the program are grouped together into units called objects. Objects are further grouped into classes, which define the attributes objects must have.A simple example of a class is the class Book.Objects within this class might be Novel and Short Story. Objects also have certain functions associated with them, called methods. The computer accesses an object through the use of one of the object's methods. The method performs some action to the data in the object and returns this value to the computer. Classes of objects can also be further grouped into hierarchies, in which objects of one class can inherit methods from another class. The structure provided in object-oriented languages makes them very useful for complicated programming tasks.


What is a constructor and its mandatory to use constructor in a class?

Constructor is a special block of code similar to the method that is used to initialize the state of objects. If you do not define a constructor in a class, Java compiler automatically put a default constructor in the class.


What kinds of game-related classes would be best implemented as abstract?

That would depend on what type of game you are developing. Unlike a concrete class which can be instantiated in its own right, an abstract class can only be instantiated through derivation. In other words, an abstract class can only be used as a base class, and is known as an abstract base class for that reason. We can also refer to them as abstract data type, given a class is also a type.We typically use an abstract base class to define a common interface for all its derivatives. If we need to divide the interface to cater for specialisations, we can derive intermediate base classes from the abstract base class. In this way we do not pollute the common base class with uncommon virtual methods.Abstract base classes typically have no data members and thus incur no memory overhead. However, if data members are required, they should be kept to a minimum and should only be declared if essential to the derivatives. Data members that are essential to some but not all derivatives should be placed in the appropriate intermediate class instead.In a game (or indeed any program) we might have many objects of many different types. However, objects that have a common public base class (including abstract base classes) can be treated as being "of the same type" (the common base). For instance, we might define an abstract Object base class such that all classes that publicly derive from the Object class can be treated as being of the same type (an Object).In a game we typically have objects that cannot be moved (static objects) and objects that can be moved (non-static). We can separate the two types of object by deriving Static and Nonstatic abstract base classes from our common Object class. We can then derive further intermediate classes from these two classes to cater for all the different types of object in our game. For instance, an armoury usually provides a choice of weapon and allows the user to select a primary and secondary weapon, thus we can derive a common Weaponabstract base class from our Nonstatic abstract base class, and then derive concrete (specific) weapons from the Weaponclass.

Related questions

What is class in computer program language?

I am assuming that you would like the definition of the word "class" as used in Java and other OOP programming languages.A class is like a blueprint for objects. Just like one blueprint can be used to make many houses, or one stamp can make many prints, one class can make many objects through the use of the new keyword.In Java, you would define a class using the keyword classfollowed by the name of the class, followed by the body of the class. For example:public class Programmer extends Person implements Nerd {public void drinkCoffee(Coffee c) { // code here... }public Program writeCode(Spec spec) { // more code here...}}In the Programmer class, there are 2 methods, or procedures: drinkCoffee and writeCode.


What is the difference between class variables and instance variables?

In the case of an instance variable, there is one copy for every instance (object). If you create 10 objects based on a class, there will be 10 copies of the variable. A class variable exists only once for the entire class - no matter how many objects you create - or even if you create no objects based on the class. In Java, such variables (class variables) are declared with the statickeyword.


When you make a c program in c language then how many types class are required?

It depends on what you mean by 'types class'. Here is the shortest C program, without any 'types class': int main (void) { return 0; }


How many chances are given for the compartment in 12th?

3 chances for class 12th/ one chances for class 10th


How do you write a c program to show How many Friday the 13th are there in a given year?

165


What is the difference between a concept and a definition?

A concept is a label (a word or a phrase) that captures the essence possessed by a class of objects. It is an abstracted essence of a class of objects that is shared by all the members of the class.A definition expatiates the abstracted essence in terms of the genus the objects belong to and specifying the principle or element that differentiates the given class of objects (the species) from the genus.The concept of man, for example, refers to the essence that is common to all human beings amidst the great many individual differences that humans posses.A definition of the concept of man (e.g., "Man is a rational animal") elaborates the concept by identifying the genus (animal) and specifying rationality as the differentiating element.-MJ Arul.


How many pupils like chocolate?

Out of any given class, approximately 90% will like chocolate.


What is objects in vb.net?

In order to understand an Object in VB.NET (Object oriented programming), we need to understand the concept of classes in OOPS. A class is a construct that encapsulates data together with its behavior or functionality as one logical unit. Thus they act as blueprints. Instances of classes are called objects. One can define many objects of a class that will differ form ecah other.


What is static variable in the class for c plus plus?

Static member variables are local to the class. That is, there is only one instance of a static member variable, regardless of how many objects are instantiated from the class. As such, they must be declared inside the class, and defined outside of the class.


What are the major types of high level programming languages?

he High Level Language is basically classified into 3 types namely:Procedural LanguageFunctional LanguageObject Oriented LanguageProcedural Language:The most common high-level languages today are procedure-oriented languages. In these languages, one or more related blocks of statements that perform some complete function are grouped together into a program module, or procedure, & given a name such as "Procedure A." If the same sequence of operations is needed elsewhere in the program, a simple statement can be used to refer back to the procedure. In essence, a procedure is just a mini-program. A large program can be constructed by grouping together procedures that perform different tasks.Procedural languages allow programs to be shorter and easier for the computer to read, but they require the programmer to design each procedure to be general enough to be used in different situations.Functional Language:Functional languages treat procedures like mathematical functions and allow them to be processed like any other data in a program. This allows a much higher and more rigorous level of program construction. Functional languages also allow variables-symbols for data that can be specified and changed by the user as the program is running-to be given values only once. This simplifies programming by reducing the need to be concerned with the exact order of statement execution, since a variable does not have to be redeclared, or restated, each time it is used in a program statement. Many of the ideas from functional languages have become key parts of many modern procedural languages.Object Oriented Language:Object-oriented languages are outgrowths of functional languages. In object-oriented languages, the code used to write the program and the data processed by the program are grouped together into units called objects. Objects are further grouped into classes, which define the attributes objects must have.A simple example of a class is the class Book.Objects within this class might be Novel and Short Story. Objects also have certain functions associated with them, called methods. The computer accesses an object through the use of one of the object's methods. The method performs some action to the data in the object and returns this value to the computer. Classes of objects can also be further grouped into hierarchies, in which objects of one class can inherit methods from another class. The structure provided in object-oriented languages makes them very useful for complicated programming tasks.


How many usable host are available given to class c ip address with subnetting address?

254


How many networks will be created using a 255.255.0.0 given a class A IP Network ie10.0.0.0?

Over 16,000,000