23.11.2017 Views

java_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Java<br />

}<br />

}<br />

Vector dayNames = new Vector();<br />

dayNames.add("Sunday");<br />

dayNames.add("Monday");<br />

dayNames.add("Tuesday");<br />

dayNames.add("Wednesday");<br />

dayNames.add("Thursday");<br />

dayNames.add("Friday");<br />

dayNames.add("Saturday");<br />

days = dayNames.elements();<br />

while (days.hasMoreElements()){<br />

System.out.println(days.nextElement());<br />

}<br />

This will produce the following result:<br />

Sunday<br />

onday<br />

Tuesday<br />

Wednesday<br />

Thursday<br />

Friday<br />

Saturday<br />

The Collection Classes<br />

Java provides a set of standard collection classes that implement Collection interfaces.<br />

Some of the classes provide full implementations that can be used as-is and others are<br />

abstract class, providing skeletal implementations that are used as starting points for<br />

creating concrete collections.<br />

389

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!