What's the purpose of generics in the following:
Posted: Mon Aug 12, 2013 8:30 am
Hi everyone,
Directly from this java tutorial: http://docs.oracle.com/javase/tutorial/ ... /dirs.html
I mean I thouroughly understand generics... however in this example it is unclear to me why it has been "genericsized".
Furthermore also in the Walking File Tree operation we have to implement FileVisitor which is genericsized too.. I mean, it will be used only for path object.. why not put directly in the parameners a Path placeholder?
Is there something I am missing about generics?
Could you please give me some insights about it?
Thanks in advance.
The_Nick.
Directly from this java tutorial: http://docs.oracle.com/javase/tutorial/ ... /dirs.html
Code: Select all
DirectoryStream.Filter<Path> filter =
newDirectoryStream.Filter<Path>() {
Furthermore also in the Walking File Tree operation we have to implement FileVisitor which is genericsized too.. I mean, it will be used only for path object.. why not put directly in the parameners a Path placeholder?
Is there something I am missing about generics?
Could you please give me some insights about it?
Thanks in advance.
The_Nick.