Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package javaapplication2;
  7.  
  8. /**
  9. *
  10. * @author student
  11. */
  12. public class Profesor extends Persoana{
  13. private String materie;
  14.  
  15. public Profesor(String materie, String nume){
  16. super(nume);
  17. this.materie = materie;
  18. }
  19.  
  20. public Profesor(String materie){
  21. this.materie = materie;
  22. this.nume = "DEFAULT";
  23. }
  24.  
  25. public Profesor(){
  26. this.materie = "haha";
  27. this.nume = "Default";
  28. }
  29.  
  30. @Override
  31. public String toString() {
  32. return "Profesor{" + "materie=" + materie + '}';
  33. }
  34. public void preda(){
  35. System.out.println(this.nume);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement