A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCA Java SE 8 Programmer I Study Guide
this week in the
Java in General
Joined: Jan 16, 2008
Jan 16, 2008 02:58:00
Can anybody tell me whether we can create a instance of type subclass using superclass constructor?
Joined: Dec 26, 2007
Jan 16, 2008 03:13:00
You mean to say:
Child c=new Parent();
No..This is not valid in
You can only have a Parent type reference to a child type object but not vice versa.
SCJP 5.0<br />SCWCD 5.0
Joined: Dec 11, 2004
Jan 16, 2008 04:12:00
Please check your private messages.
How to ask a question...
Simple Servlet Examples
I agree. Here's the link:
object creation with super() and constructor
Inheritance and Constructors...
Determining where static is running
question from Dan's exam - ClassCastException
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015