473,320 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Can a class have two superclasses at the same time?

108 100+
I have a class Journey which I want to make a superclass and another class plannedjourney.
The plannedjourney class extends JFrame since it contains forms..However I also want this class to extends Journey..

Is there a possible way to do this?
Jan 4 '11 #1

✓ answered by Dheeraj Joshi

Or you can also use inner classes. I guess if you do not want interfaces better to use inner classes.

Regards
Dheeraj Joshi

3 2128
Dheeraj Joshi
1,123 Expert 1GB
You can use interfaces.

Regards
Dheeraj Joshi
Jan 4 '11 #2
Dheeraj Joshi
1,123 Expert 1GB
Or you can also use inner classes. I guess if you do not want interfaces better to use inner classes.

Regards
Dheeraj Joshi
Jan 4 '11 #3
horace1
1,510 Expert 1GB
See the following discussion "Why not multiple inheritance?" in Javaworld
http://www.javaworld.com/javaqa/2002...heritance.html
Jan 4 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: sdhyok | last post by:
Hi, I am trying to build up a system handling time series data a lot. Do you know any well-designed python class specially for time series data? Thanks in advance. Shin, Daehyok
2
by: Hallvard B Furuseth | last post by:
How do I find a class' immediate superclasses? That is, given class A: pass class B(A): pass class C(A): pass class D(B, C): pass I want a function foo where foo(D) or foo(D())...
50
by: Dan Perl | last post by:
There is something with initializing mutable class attributes that I am struggling with. I'll use an example to explain: class Father: attr1=None # this is OK attr2= # this is wrong...
0
by: Chady S. | last post by:
Hi, My application contains 3 web service classes that each contain a considerable number of functions. I am not doing any precompiling as it was suggested that JIT could offer more...
3
by: Gregory Bond | last post by:
I'm building a class hierarchy that needs to keep as a class variable a reference to a (non-member) function, so that different subclasses can use different generator functions. But it seems...
7
by: Carlos | last post by:
Hi! class A: X = 2 def F(): print A.X F() The above fails because the name A is not yet at global scope when the reference A.X
166
by: Graham | last post by:
This has to do with class variables and instances variables. Given the following: <code> class _class: var = 0 #rest of the class
3
by: Sharon | last post by:
What will be the best class for time representation? i need simple interaction ( convert string to time , get time ...) format time : "08:00" "22:09" is DataTime the best class for me ?
29
by: Brad Pears | last post by:
Here is a simple OO design question... I have a Contract class. The user can either save an existing contract or they start off fresh with a blank contract, fill in the data and then save a...
8
by: oh.i.love.spam | last post by:
I've been a procedural PHPer for a while now and I don't know why it has taken me so long to start the jump from procedural to OOP. I have a function that I would use for doing length...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.