📚 Practice Mode
Java and Perl Programming Quiz
Learn at your own pace with hints and detailed explanations
1 / 20
Multiple Answers
12 You have these files in the same directory. What will happen when you attempt to compile and run Class1.java if you have not already compiled Base.java //Base.java package Base; class Base{ protected void amethod(){ System.out.println("amethod"); }//End of amethod }//End of class base package Class1; //Class1.java public class Class1 extends Base{ public static void main(String argv[]){ Base b = new Base(); b.amethod(); }//End of main }//End of Class1
- a. Compile Error: Methods in Base not found
- b. Compile Error: Unable to access protected method in base class
- c. Compilation followed by the output "amethod"
- d. Compile error: Superclass Class1.Base of class Class1.Class1 not found