Lab - sthn 8esh auth s position--; // meiwnw to position...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
public class Lab { public Lab(String name){ p this.name = name; pin = new Student[22]; position=0; } public void insertStudent(Student s){ p if (position<pin.length)//ean exw eleu8eres 8eseis { pin[position] = s;//topo8ethse sthn 8esh position ton foithth p position++;// au3hse to position kata ena } else System.out.println("To ergasthrio einai gemato!!!"); } public int searchStudent(int am){ p for(int i=0;i<position;i++) f if (pin[i].getAm()==am) i return i; r return -1; } public boolean deleteStudent(int am){ p int pos = searchStudent(am); i if (pos>=0) { pin[pos]=null; // sbhnw ton foithth p pin[pos] = pin[position-1]; // antigrafw ton teleutaio foithth
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: sthn 8esh auth s position--; // meiwnw to position kata ena p return true; // epistrefw ok } else return false; // den egine h diagrafh . .epistrefw false r } public String toString(){ p String output=""; S output+="ERGASTHRIO : "+name+ "\nARI8MOS FOITHTWN : "+position; " for(int i=0;i<position;i++) output+="\n"+pin[i]; o return output; } public int size(){ p return position; } public boolean isEmpty(){ p return size()==0; } public boolean isFull(){ p return size()==pin.length; } // PRIVATE INSTANCE FIELDS private String name; private int position; private Student pin; }...
View Full Document

This note was uploaded on 04/26/2010 for the course COMPUTER S Java2 taught by Professor Kwstasmixail during the Spring '10 term at Technical University of Crete.

Page1 / 2

Lab - sthn 8esh auth s position--; // meiwnw to position...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online