It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Java Forum

accessing super class

accessing super class

Postby sjaakie on Mon Apr 16, 2007 12:33 pm

Hello,

I'm pretty new to Java, so far I've managed to do most stuff on my own, however I bumped into something that I can't seem to accomplish on my own, I made a project with several classes as below:
Code: Select all
                              class A
                     class B         class C
                                  class D  class E

Class A is the superclass and would be divided into class B and class C(which has two sub-classes(D + E)), I can access the class A's constructor from class B with super(), but how do I access Class A's constructor from class D or class E?

tia
sjaakie
 
Posts: 0
Joined: Mon Apr 16, 2007 11:10 am

Postby ggomez on Tue Apr 17, 2007 3:37 am

your "C" class can access "A" class and your "D" class can access "C" class

so, you can redefine the methods of the "A" class in the "C" class so you can use them in the "D" class.

good luck.
ggomez
 
Posts: 45
Joined: Tue Apr 17, 2007 3:30 am
Location: !!!!!MéXiCo¡¡¡¡¡¡


Who is online

Users browsing this forum: No registered users and 2 guests