Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling Class

843789Aug 8 2010 — edited Aug 9 2010
Hello everybody. I have a question. Suppose I have a Class hierarchy like :
public class ClassA extends Class {
	public ClassA() {
	}

	public class ClassB extends ClassA {
		public ClassB() {
		}
	}
}
And I want to Instantiate ClassB like
 new ClassA().ClassB();
. Is it possible or valid? If possible then which modifier should I use or any other way.
Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2010
Added on Aug 8 2010
18 comments
267 views