Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Persno;
- public class TestPerson {
- public static void nameOfEverything(Student[] arr1, Teacher[] arr2, Course[] arr, int num) {
- for(int i = 0; i < arr.length; i++) {
- if(arr[i].getNumber() == num) {
- System.out.println("" + arr1[i] + arr2[i] + arr[i]);
- }
- }
- }
- public static void main(String[] args) {
- Course[] school = new Course[3];
- Teacher[] teach = new Teacher[3];
- Student[] buddy = new Student[3];
- Course student1 = new Course("Mat", 5);
- Course student2 = new Course("Bel", 4);
- Course student3 = new Course("Geografiq", 7);
- school[0] = student1;
- school[1] = student2;
- school[2] = student3;
- Teacher teach1 = new Teacher("Georgi", "60021", school);
- Teacher teach2 = new Teacher("Ivan", "996", school);
- Teacher teach3 = new Teacher("Petkan", "6598", school);
- teach[0] = teach1;
- teach[1] = teach2;
- teach[2] = teach3;
- Student budy1 = new Student("Petar Petrov", "854786", "56485200");
- Student budy2 = new Student("Georgi Dragiv", "87546", "56485200");
- Student budy3 = new Student("Petkan Petkanov", "80231", "56485200");
- buddy[0] = budy1;
- buddy[1] = budy2;
- buddy[2] = budy3;
- for(int i = 0; i < school.length; i++) {
- System.out.println("" + buddy[i] + teach[i] + school[i]);
- }
- System.out.println("");
- nameOfEverything(buddy, teach, school, 7);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement