Results 1 to 2 of 2
- 01-30-2012, 04:56 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 4
- Rep Power
- 0
Superclass and Subclass Constructor Question
Which constructor(s) is called for student and explain why?Java Code:public class bus { public bus(int number) { passengers = number; } public bus () { passengers = 0; } … } public class student extends bus { public student(double money){ lunch = money; } … }
- 01-30-2012, 05:05 AM #2
Re: Superclass and Subclass Constructor Question
Let's see:
-- Class names beginning with a lowercase letter
-- Inappropriate inheritance
-- Question unrelated to the code posted
Rather than seek a nonexistent answer to one rather silly question, go through a good tutorial or book where you can actually learn Java.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Array of Objects (Superclass containing Subclass)
By stupidwaldo in forum New To JavaReplies: 47Last Post: 12-12-2011, 01:29 PM -
Override a superclass's methods with a subclass
By zach&kody in forum New To JavaReplies: 7Last Post: 05-24-2011, 02:50 PM -
Using superclass fields in subclass method
By lonegreyride in forum New To JavaReplies: 12Last Post: 11-17-2010, 01:21 PM -
superclass and subclass
By mr idiot in forum New To JavaReplies: 19Last Post: 01-03-2009, 07:29 AM -
which class is superclass and subclass?
By java_fun2007 in forum New To JavaReplies: 0Last Post: 12-11-2007, 08:55 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks