I put this code in the compiler
package com.employer.constractor;
public class ConstractorDemo extends A{
public ConstractorDemo(){
System.out.print("Demo");
}
public static void main(String[] args){
new ConstractorDemo();
}
}
class A {
A(){
System.out.print("A");
}
}
And that gave "ADemo"
why? I would appreciate a detailed answer to this case and mention how the compiler will deal with this
user4786272
source
share