Can You Define Classes Concept In Object-Oriented Programming?
Classes concept in OOP.
3 Answers - Sort by: Date | Rating
In OOP objects are the members of classes. What does this mean? Let's look at an analogy. Almost all computer languages have built-in data types. For instance, a data type int, meaning integer, is predefined in C++. You can declare as many variables of type int as you need in your program:
Int day;
Int count;
Int divisor;
Int answer;
In a similar way, you can define many objects of the same class. A class serves as a plan, or template. It specifies what data and what functions will be included in objects of that class. Defining the class doesn't create any objects, just as the mere existence of data type int doesn't create any variables.
A class is thus a description of a number of similar objects. This fits our non-technical understanding of the word class. Prince, sting, and Madonna are members of the class of rock musicians. There is no one person called "rock musician," but specific people with specific names are members of this class if they possess certain characteristics.
Int day;
Int count;
Int divisor;
Int answer;
In a similar way, you can define many objects of the same class. A class serves as a plan, or template. It specifies what data and what functions will be included in objects of that class. Defining the class doesn't create any objects, just as the mere existence of data type int doesn't create any variables.
A class is thus a description of a number of similar objects. This fits our non-technical understanding of the word class. Prince, sting, and Madonna are members of the class of rock musicians. There is no one person called "rock musician," but specific people with specific names are members of this class if they possess certain characteristics.
0
0
Re usability in Object-Oriented Programming has a key importance, once a class has been written, created, and debugged, it can be distributed to other programmers for use in their own programs. This is called re usability. It is similar to the way a library of functions in a procedural language can be incorporated into different programs.
However, in OOP, the concept of inheritance provides an important extension to the idea of reusability. A programmer can take an existing class and, without modifying it, add additional features and capabilities to it. This is done by a deriving a new class from the existing one. The new class will inherit the capabilities of the old one, but is free to add new features of its own.
For example, you might have written (or purchased from someone else) a class that creates a menu system, such as that used in Windows or other Graphic User Interfaces (GUIs). This class works fine, and you don't want to change it, but you want to add the capability to make some menu entries flash on and off. To do this, you simply create a new class that inherits all the capabilities of the existing one but adds flashing menu entries.
However, in OOP, the concept of inheritance provides an important extension to the idea of reusability. A programmer can take an existing class and, without modifying it, add additional features and capabilities to it. This is done by a deriving a new class from the existing one. The new class will inherit the capabilities of the old one, but is free to add new features of its own.
For example, you might have written (or purchased from someone else) a class that creates a menu system, such as that used in Windows or other Graphic User Interfaces (GUIs). This class works fine, and you don't want to change it, but you want to add the capability to make some menu entries flash on and off. To do this, you simply create a new class that inherits all the capabilities of the existing one but adds flashing menu entries.
0
0
In OOP objects are the members of classes. What does this mean? Let's look at an analogy. Almost all computer languages have built-in data types. For instance, a data type int, meaning integer, is predefined in C++. You can declare as many variables of type int as you need in your program:
Int day;
Int count;
Int divisor;
Int answer;
In a similar way, you can define many objects of the same class. A class serves as a plan, or template. It specifies what data and what functions will be included in objects of that class. Defining the class doesn't create any objects, just as the mere existence of data type internet doesn't create any variables.
A class is thus a description of a number of similar objects. This fits our non-technical understanding of the word class. Prince, sting, and Madonna are members of the class of rock musicians. There is no one person called "rock musician," but specific people with specific names are members of this class if they possess certain characteristics.
Int day;
Int count;
Int divisor;
Int answer;
In a similar way, you can define many objects of the same class. A class serves as a plan, or template. It specifies what data and what functions will be included in objects of that class. Defining the class doesn't create any objects, just as the mere existence of data type internet doesn't create any variables.
A class is thus a description of a number of similar objects. This fits our non-technical understanding of the word class. Prince, sting, and Madonna are members of the class of rock musicians. There is no one person called "rock musician," but specific people with specific names are members of this class if they possess certain characteristics.
0
0
- Generate An Object-oriented Design For A System That Keeps Tracks Of Your CD And DVD Collection?
- What Is Local Procedural Call?
- What Are Difference Between Local And Remote Procedural Call?
- How Can I Compress Image Through Java?
- How To Enable Java Script On Windows Vista?
- How To Et Rid Of Error 1606?
- How To Enable Javascript On A Cricket Captr A200 Cell Phone With A 6.3.0.7."Openwave" Browser That I Cant Change Either,or Can I?
- How To Enable Javascript On A Cricket A200?
- How Can I Create A Online Banking Database?
- What I S Java Script?
- 1.7. What Is A Database System?
- How To Make Use-case Diagram , Class Diagram,Activity Diagram For Car Services?
- What Is Deference Between If Statement And Switch Statement?
- What Does |= And &= Means In C++?
- Cheat Sheet On Java Programming How To Use Methods, Arrays,loops,number-counters?
- 2. What Is Conditional Operator?
- How Can I Describe A Erd?
- I'm Having A Problem With The Error Code 25099 Unzipping Core File Failed.I've Tried Everything I Can Think Of. ?
- How Do I Enable Javascript On My Phone-txtm8t?
- How Do I Enable Cookies On AOL Web Browser?
- Write A Program In C++ That Reads In Five Digit Integer And Determine Whether It's A Palindrome?
- How Do You Write The Numbers 2 Through 10 In A Report?
- I'm On A BBC Website And Am Trying To Watch One Of Their Videos And I Get A Message Saying ' For The Best Possible Listening Experience, Please Enable JavaScript? I've Enable Active Scripting In I Nt Opt/Sec/Cus/Scripting But Still No Joy. Any Ideas?
- I'm On The BBC Sport Website And Am Trying To Watch One Of Their Videos And I Get A Message Saying ' For The Best Possible Listening Experience, Please Enable JavaScript?
- Can You Define Reusability In Object-Oriented Programming?
- What Is Object Oriented Programming?
- What Is Object Oriented Programming Paradigm?
- What Makes Object Oriented Programming Different?
- Why Is Java Not A Pure Object Oriented Programming?
- What Is Object Oriented Programming And What Are Its Benefits N Disadvantages?
- What Are The Differences Between Object Oriented Programming And Generations Programming?
- What Is Difference Between Structure Programming And Object Oriented Programming?
- Why Is Java Called Object Oriented Programming Language?
- How Does Object Oriented Programming Differs From Structured Programming?Explain
- Can You Explain Why VB.Net Is An Object-Oriented Programming Language?
- Can You Compare Event Driven Programming With Object-oriented Programming (OOP)?

New Comment - Comments are editable for 5 min.