This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubts in java.lang Dbt #1

 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to java.lang "Process" is an Abstract class , also, we cannot instantiate "Runtime" class.......does it mean Runtime is also abstract class ?......How can a method of "Runtime" class (.....i.e., "exec()" ) return an object of "Process" class when we know that "Process" class is abstract and that it cannot be instantiated ?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't return an object of Process class. It returns an object whose type is compatible with Process -- i.e, a package-private subclass of Process. This pattern shows up all over the Java APIs -- it's a very fundamental concept in object-oriented programming.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic