How can I include one java file into another java file?
For example:
If I have 2 java file one is called Person.java and one is called Student.java. How can I include Person.java into Student.java so that I can extend the class from Person.java in Student.java
Just put the two files in the same directory. Here’s an example:
Person.java
Student.java
Running Student (since it has the main function) yields us the desired outcome: