wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes another question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "another question" Watch "another question" New topic
Author

another question

kavita s. kumar
Greenhorn

Joined: Oct 26, 2001
Posts: 16
Consider the following class definition:
1. public class Test extends Base {
2. public Test(int j) {
3. }
4. public Test(int j, int k) {
5. super(j, k);
6. }
7. }
Which of the forms of constructor must exist explicitly in the definition of the Base class?
an anyone solve my prob
Fei Ng
Ranch Hand

Joined: Aug 26, 2000
Posts: 1242
Originally posted by kavita s. kumar:
Consider the following class definition:
1. public class Test extends Base {
2. public Test(int j) {
3. }
4. public Test(int j, int k) {
5. super(j, k);
6. }
7. }
Which of the forms of constructor must exist explicitly in the definition of the Base class?
an anyone solve my prob

Base() {}
Base(int j, int k) {}
kavita s. kumar
Greenhorn

Joined: Oct 26, 2001
Posts: 16
could u eplain me how Base(){}??
Ahmed Haboubi
Ranch Hand

Joined: Oct 21, 2000
Posts: 36
Base() because in any child class constructor, if there's no explicit call to this(..) or supre(..), the compiler will implicitly insert super(). So, there has to be a Base() in the parent class.
I hope this helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: another question
 
Similar Threads
Constructor
Question on constructors
class question
Constractors
Mock Exam question