Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Primner bez nasledjivanja
- public class Studnet{
- private string ime;
- private string prezime;
- private string pol;
- private string godiste;
- private string brojIndeksa;
- }
- public class Profesor{
- private string ime;
- private string prezime;
- private string pol;
- private string godiste;
- private int godineStaza;
- private string departman;
- }
- //Primer sa nasledjivanjem
- public class Osoba{
- //Sa protected modifikatorom pristupa, klase naslednice ce moci da menjaju vrednosti ovih polja
- protected string ime;
- protected string prezime;
- protected string pol;
- protected string godiste;
- }
- public class Studnet : Osoba{
- private string brojIndeksa;
- }
- public class Profesor: Osoba{
- private int godineStaza;
- private string departman;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement