12. class Dog extends Animal


#1

I passed this exercise and the concept is pretty simple, but am wondering,
since the Animal class is in a different file altogether, how does Java know to get this class?
They are in 2 separate files. Can someone explain please in simple terms. Thanks in advance :slight_smile:


https://www.codecademy.com/en/courses/learn-java/lessons/object-oriented-programming/exercises/inheritance?action=lesson_resume&link_content_target=interstitial_lesson


`


#2

Their in the same package. From Wikipedia: "A Java package is a technique for organizing Java classes into namespaces similar to the modules of Modula, providing modular programming in Java. Java packages can be stored in compressed files called JAR files, allowing classes to be downloaded faster as groups rather than individually."


#3

Thanks for the explanation darren. Simple, to the point and easy to understand :slight_smile:


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.