File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes java programmer certificate 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 "java programmer certificate" Watch "java programmer certificate" New topic

java programmer certificate

Kameshwar Prasad

Joined: Dec 04, 2007
Posts: 12
the fallowing code is from Jargon test ( this progra is being compiled giving

No constructor matching Base() found in class Base.
Child(int i) { test (); }
as there is no call for default base constructor in child class
why this error ?

class Base
Base(int i) { test(); }
// Base(){}
void test() {


public class Child extends Base {

byte b = 1 ;
Child(int i) { test (); }
Child(float f) { this ((int)f); }
void test() {

static public void main(String[] a) {
new Child(10.8f).test();


[This message has been edited by maha anna (edited April 23, 2000).]
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

All base class constructors call the super class
constructor first. It is always considered a good
programming habit if you explicitly call (IMO).
If you donot explicitly call the super class
constructor explicitly, then the JDK will make the
call on your behalf. Since in this example you din't
make the call explicitly, JDK calls the default super
class constructor which takes no arguments. Now, in the
super class you did provide a constructor explicitly.
Hence the default constructor is not avail for this super
class. Hence the ERROR.
Hope this helps.
- satya
Consider Paul's rocket mass heater.
subject: java programmer certificate
jQuery in Action, 3rd edition