• Post Reply Bookmark Topic Watch Topic
  • New Topic

FileChannels  RSS feed

 
Sandya Bhaskara
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This is an example program in "Thinking in java"...my question is ..the transferFrom/To methods are abstract (according to documentation)...so how the program works??(just compiled and executed it)
 
Joe Ess
Bartender
Posts: 9426
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

returns some class which is not abstract but extends the abstract class FileChannel. Since it extends FileChannel, we can use a reference of type FileChannel to invoke methods on it. This is the miracle of polymorphism, a very useful object-oriented design technique.
 
Sandya Bhaskara
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Joe,thanx for the clarification....
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!