Created
March 12, 2022 23:04
-
-
Save ibrahimdoss/6192ca6a820fe643cc361eeff877047f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CompositionMain { | |
public static void main(String[] args) { | |
//College nesne create | |
College collegeOne = new College("Abc College", "Def College"); | |
College collegeTwo = new College("Xyz College", "Mnp College"); | |
College collegeThree = new College("High College", "Super College"); | |
//create edilenleri listeye atıyoruz. | |
List<College> college = new ArrayList<College>(); | |
college.add(collegeOne); | |
college.add(collegeTwo); | |
college.add(collegeThree); | |
University university = new University(college); | |
List<College> colleges = university.getTotalCollegesUniversity(); | |
for (College college2 : colleges) { | |
System.out.println("Name : " + college2.name | |
+ "and" + "Address : " + college2.address); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment