Advertisement
Guest User

vladutt2

a guest
Oct 23rd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 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 javaapplication34;
  7.  
  8. import java.util.List;
  9.  
  10. /**
  11. *
  12. * @author Guest
  13. */
  14. public interface Student<T extends Number> {
  15. private String name="";
  16. private String surname;
  17. // private int age;
  18. private List<T> note;
  19.  
  20. public Student(String name, String surname, int age) {
  21. this.name = name;
  22. this.surname = surname;
  23. this.age = age;
  24. }
  25.  
  26. public String getName() {
  27. return name;
  28. }
  29.  
  30. public void setName(String name) {
  31. this.name = name;
  32. }
  33.  
  34. public String getSurname() {
  35. return surname;
  36. }
  37.  
  38. public void setSurname(String surname) {
  39. this.surname = surname;
  40. }
  41.  
  42. public int getAge() {
  43. return age;
  44. }
  45.  
  46. public void setAge(int age) {
  47. this.age = age;
  48. }
  49.  
  50. public List<T> getNote() {
  51. return note;
  52. }
  53.  
  54. public void setNote(List<T> note) {
  55. this.note = note;
  56. }
  57.  
  58. public void setNotes(Integer ... notes){
  59. for(Integer nota: notes){
  60. note.add((T)nota);
  61. }
  62. }
  63.  
  64.  
  65.  
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement