fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. public class Exam1 {
  8. public static void main(String[] args) {
  9. ContractEmployee arun = new ContractEmployee();
  10. arun.freeTime(); }
  11. }
  12.  
  13. class Employee{
  14. final void timeOut(){
  15. System.out.println("Its time out zone");
  16. }
  17. }
  18.  
  19. class ContractEmployee extends Employee{
  20. final void freeTime(){
  21. timeOut();
  22. }
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:7: error: class Exam1 is public, should be declared in a file named Exam1.java
public class Exam1 {
       ^
1 error
stdout
Standard output is empty