Why we use class? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why we use class?

i dont know when use i class ? Ł„Ų§ Ų£Ų¹Ł„Ł… Ł…ŲŖŪŒ Ų£Ų³ŲŖŲ¹Ł…Ł„ Ų§Ł„Ś©Ł„Ų§Ų³

8th Jan 2017, 11:17 AM
abdellah khaddou
abdellah khaddou - avatar
1 Resposta
+ 1
Classes are used to define programmatic objects. It is not merely about making code more readable, but also more extensible. For instance, if you define a class "person", that class can contain all the required variables to describe a person, such as name, age, height, weight. You can then inherit the "person" class in an "employee" class that adds information such as department, id_number. But you can also inherit the "person" class into a "customer" class that has info you need to track your customer and get in touch, such as email_address. The class can also include methods that your program can use to interact with the objects. It'll all come up later in the course.
8th Jan 2017, 1:25 PM
Myk Dowling
Myk Dowling - avatar