Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 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 Student extends Persoana{
  13. private int mark;
  14. public Student(int mark, String nume){
  15. super(nume);
  16. this.mark = mark;
  17. }
  18.  
  19. public Student(int mark)
  20. {
  21. this.mark = mark;
  22. this.nume = "default";
  23. }
  24.  
  25. public Student()
  26. {
  27. this.mark = 0;
  28. this.nume = "default";
  29. }
  30.  
  31. @Override
  32. public String toString() {
  33. return "Student:" + super.toString() + ","+this.mark;
  34. }
  35. public void invata(){
  36. System.out.println(this.nume + "invata");
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement