Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- @SuppressWarnings("serial")
- public class Student implements Serializable {
- private String ime;
- private String prezime;
- private int indeks;
- public Student() {
- ime = "Nepoznato";
- prezime = "Nepoznato";
- indeks = -1;
- }
- public Student(String ime, String prezime, int indeks) {
- super();
- this.ime = ime;
- this.prezime = prezime;
- this.indeks = indeks;
- }
- public String getIme() {
- return ime;
- }
- public void setIme(String ime) {
- this.ime = ime;
- }
- public String getPrezime() {
- return prezime;
- }
- public void setPrezime(String prezime) {
- this.prezime = prezime;
- }
- public int getIndeks() {
- return indeks;
- }
- public void setIndeks(int indeks) {
- this.indeks = indeks;
- }
- public boolean equals(Object obj) {
- if(obj == null) return false;
- if(obj == this) return true;
- Student st = (Student) obj;
- return (ime.equals(st.ime) && prezime.equals(st.prezime) && indeks==st.indeks);
- }
- public String toString() {
- return ime + " " + prezime + "\t" + indeks;
- }
- }
Add Comment
Please, Sign In to add comment