wood burning stoves 2.0*
The moose likes Java in General and the fly likes doubts in java.lang Dbt #1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "doubts in java.lang Dbt #1" Watch "doubts in java.lang Dbt #1" New topic

doubts in java.lang Dbt #1

omkar patkar
Ranch Hand

Joined: Aug 25, 2005
Posts: 231
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 ?

Thanks and Regards
Omkar Patkar (SCJP 1.4)[url]http://javacollectionsnotes.blogspot.com[/url] | [url]http://omkar-myscjpexp.blogspot.com[/url]
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

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.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link: http://aspose.com/file-tools
subject: doubts in java.lang Dbt #1
Similar Threads
Use of constructor in abstract class?
abstract example
Clarification sought on calling Abstract method
How will I know how much memory can be used by my java application?