package javatutorial; public class Family{ protected void f1(){ System.out.println("family"); }}public class One extends Family { public static void main(String args[]) { Family f=new Family(); f.f1(); } }
Standard input is empty
Main.java:4: error: class Family is public, should be declared in a file named Family.java public class Family{ ^ Main.java:10: error: class One is public, should be declared in a file named One.java public class One extends Family { ^ 2 errors
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!