Object oriented programming - Example 1
I was talking about the statement, Jane is a student of the school, St. Thomas. It could be clearly seen that we are talking about two classes Student and School. What is the relationship between? In general sense, a student studies in a school. We could as well say, a school has one or more student studying in it.
How about saying this statement?
Mary is a teacher in school, St. Thomas. Thus, we could see that Teacher is another class. Now, what is the relationship between the teacher and the school. The school has one or more teacher.
So, finally we could say the following:
The school has one or more teacher.
The school has one or more student.
We have three different types or classes. They are as following:
School
Teacher
Student
One could be interested in knowing the teachers' count in the school. The same holds true for students' count.
Like following question:
How many teachers are there in St. Thomas school?
How many students are there in St. Thomas school?
Let me pause for a while. I used several times the word, CLASS? What is the term Class in object oriented programming?
Class is one of the most significant thing in object oriented programming. Class is one of the most important building block of Object oriented paradigm.
How about saying this statement?
Mary is a teacher in school, St. Thomas. Thus, we could see that Teacher is another class. Now, what is the relationship between the teacher and the school. The school has one or more teacher.
So, finally we could say the following:
The school has one or more teacher.
The school has one or more student.
We have three different types or classes. They are as following:
School
Teacher
Student
One could be interested in knowing the teachers' count in the school. The same holds true for students' count.
Like following question:
How many teachers are there in St. Thomas school?
How many students are there in St. Thomas school?
Let me pause for a while. I used several times the word, CLASS? What is the term Class in object oriented programming?
Class is one of the most significant thing in object oriented programming. Class is one of the most important building block of Object oriented paradigm.


0 Comments:
Post a Comment
<< Home