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
- What Data Redundancy In Database?
- Write A Program To Find Out How Many Upper Case Letter In A String Line?
- Why We Use This Method In Java?
- What Is A Paper Based System?
- What Is The Difference Between DBMS And File Management?
- What Are The Benefits Of Using Database Approach?
- Why Java Not Supports Multiple Inheritence?
- What Is Difference Between For And Nested For Loops?
- How Do You Feel About Database?
- How To Search Input Numbers?
- Is This A Legitimate Program?
- How To Program Uniden Bearcat BC350A?
- What Are The Advantages Of A Pointer Variable?
- What Is The Role Of Target Language In Compiler Concept?
- What Was The First Couple Languages?
- Is It Possible To Create And Use A Master Page Without Using ASP.net For My Html Code? If So, What Do You Use?
- What Are The Five Basic Types Of Files In File Organization?
- What Are The 5 Basic Types Of File?
- Create A JavaScript Function That Finds The Average Of Three (3) Values, Which Are Sent To The Function When Called?
- State The Output That Will Be Produced By The Following C++ Program : #include #include Int Square (int Y ) { Return Y*y; } Void Main ( ) { For(int X=1;x?
- Find Error(s) In Each Of The Following Code Segment And Write The Correct Statement ? I.) X=1; While(x=10); Cout
- Explain The Difference Between PROGRAMMER DEFINED FUNCTION PRE-DEFINED FUNCTION By Using Examples?
- What Object Is A Mitochondrion Similar To?
- What Was The First String Instrument In America?
- What Are The Differences Between System S/w And Application S/w?
- 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?

New Comment - Comments are editable for 5 min.