+ 3

what the oop

WHY use OOP in lanuage

5th Dec 2019, 1:11 PM
farah faissal hassan
5 Antworten
+ 2
To protect data from the rest of the code and tie it to related functionality.
5th Dec 2019, 2:12 PM
HonFu
HonFu - avatar
+ 2
I'ts basically object oriented programming. by this i mean it's the concept of using a real life objects in a code. OOP is devided into several parts in each programming language. In C++ , C# and Python we have OOP,. Below is a basic program in C# of how classes and objects works, this example doesn't include inheritance and other concepts. //you may run it on vs code, it works //Description: Introduction to OOP, "Classes and objects" using System; namespace Intro_Classes { class student { //Private Attributes private string name; private string sname; private int age; private int grade; //Public Attributes public student()//Default constructor { name = "Ghost"; sname = "Ghost_S"; grade = 0; age =0; } public student(string name,string sname,int age,int grade) { this.name=name; this.sname=sname; this.age=age; this.grade=grade; } public void Set_student(string name,string sname,int age,int grade) { this.name=name; this.sname=sname; this.age=age; this.grade=grade; } public string getname(){ return name; } public string gets_name(){ return sname; } public int getage(){ return age; } public int getgrade(){ return grade; } public string to_string() { return ("Hi my name is "+this.getname()+" and My surname is "+this.gets_name()+". I'm "+this.getage()+ "years old and i'm on grade "+this.getgrade()); } }//end of Student's class class Program { static void prompt() { Console.WriteLine("enter the name please\n"); var name = Console.ReadLine();
5th Dec 2019, 4:10 PM
Masingita Abel
Masingita Abel - avatar
+ 2
OOP(Object Oriented Programming) languages allows computer programmers to implement an object-oriented design as a working system.. Just as everything around us are seen as objects(either animate or inanimate), so does OOP languages.. For instance, in Java, classes are instantiated as objects.
5th Dec 2019, 8:22 PM
Opara Chizitere
Opara Chizitere - avatar
+ 1
I would say it is a concept of using real life objects in a code.
5th Dec 2019, 1:41 PM
Timur Myngbay
Timur Myngbay - avatar
0
OOP is awesome. Might be hard at beginning but you will see how powerfull it is and how usefull can be. It can simplify your code using templates and create generic functionality. This is also a crucial thing for security (encapsulation). In c# you can do dependency injection using Interfaces that inlements a class and have acces anywhere in your application where you choose to inject it and can easily write unit tests based on your interfaces
5th Dec 2019, 9:55 PM
Catalin Popinciuc
Catalin Popinciuc - avatar